gamesheet_sdk.teamsΒΆ

Teams dashboard SDK for GameSheet.

Functions

archive_team(session, team_id, *[, timeout])

Archive a team to remove it from active lists while preserving data.

build_rrule(frequency, *[, interval, ...])

Build an RRULE string for recurring events.

create_calendar_event_raw(session, payload, *)

Create a calendar event or practice via POST /api/calendar/events.

create_event(session, team_id, title, ...[, ...])

Create a calendar event ('event' or 'practice' type).

create_game(session, team_id, season_id, ...)

Create a scheduled game via the teams schedule-game endpoint.

create_practice(session, team_id, ...[, ...])

Create a practice calendar event ('practice' type).

create_schedule_game_raw(session, payload, *)

Create a scheduled game via POST /api/schedule-game.

delete_calendar_event(session, event_id, *)

Delete a calendar event and all of its occurrences.

delete_calendar_event_raw(session, event_id, *)

Execute raw HTTP DELETE request to delete a calendar event series.

delete_calendar_occurrence(session, ...[, ...])

Delete a calendar occurrence (optionally including all future occurrences).

delete_calendar_occurrence_raw(session, ...)

Execute raw HTTP DELETE request to delete a calendar occurrence.

delete_event(session, event_id, *[, ...])

Delete a calendar event series or occurrence.

delete_game(session, game_id, *[, timeout])

Delete a scheduled game.

delete_practice(session, practice_id, *[, ...])

Delete a practice calendar event series or occurrence.

delete_schedule_game_raw(session, game_id, *)

Execute raw HTTP DELETE request to delete a scheduled game via DELETE /api/schedule-game/{game_id}.

delete_team(session, team_id, *[, timeout])

Delete a team.

fetch_availability_raw(session, team_id, ...)

Fetch batch availability data for a team event.

fetch_calendar_raw(session, team_id, *[, ...])

Fetch raw calendar data from the teams API for a specified team.

fetch_event_occurrence_raw(session, event_id, *)

Fetch raw calendar event occurrence data from the teams API.

fetch_scheduled_game_raw(session, game_id, *)

Fetch raw game details from the teams schedule-game API.

fetch_seasons_raw(session, *[, timeout])

Fetch raw seasons data from the teams API gateway.

fetch_team_raw(session, team_id, *[, timeout])

Fetch raw data for a single team from the teams API gateway.

fetch_teams_raw(session, *[, timeout])

Fetch raw teams data from the teams API gateway.

get_calendar_subscription(team_id, *[, ...])

Generate calendar subscription URLs for a team.

get_event(session, event_id, *[, ...])

Retrieve detailed metadata for a calendar event ('event' type).

get_game(session, event_id, *[, ...])

Retrieve detailed metadata for a scheduled game ('game' type).

get_practice(session, event_id, *[, ...])

Retrieve detailed metadata for a practice ('practice' type).

get_schedule_event(session, event_id, *[, ...])

Retrieve detailed metadata for a calendar event occurrence or scheduled game.

get_season(session, season_id, *[, timeout])

Retrieve detailed information for a specific season, excluding penaltyCodes and teams.

get_season_penalty_codes(session, season_id, *)

Retrieve all penalty codes configured for a specific season.

get_season_teams(session, season_id, *[, ...])

Retrieve all teams participating in a specific season.

get_team(session, team_id, *[, timeout])

Retrieve detailed information for a specific team.

list_events(session, team_id, *[, month, ...])

List calendar events ('event' type) for a team.

list_games(session, team_id, *[, month, ...])

List scheduled games ('game' type) for a team.

list_lookups(*[, timeout])

Fetch all lookup categories from the teams API.

list_practices(session, team_id, *[, month, ...])

List practices ('practice' type) for a team.

list_schedule(session, team_id, *[, ...])

List schedule events for a team, optionally filtered by event type.

list_seasons(session, *[, timeout])

Fetch and summarize all seasons available to the authenticated user.

list_teams(session, *[, timeout])

Fetch and summarize all teams available to the authenticated user.

refresh_access_token(refresh_token, *[, timeout])

Exchange a refresh token for a fresh {access, refresh} pair via the teams API gateway.

restore_team(session, team_id, *[, timeout])

Restore an archived team back to active lists.

unarchive_team(session, team_id, *[, timeout])

Restore an archived team back to active lists.

update_calendar_occurrence(session, ...[, ...])

Update a calendar occurrence and return validated CalendarEventCreated model.

update_calendar_occurrence_raw(session, ...)

Execute raw HTTP PUT request to update an occurrence via PUT /api/calendar/occurrences/{occurrence_id}.

update_event(session, occurrence_id, *[, ...])

Update a non-game calendar event occurrence.

update_game(session, game_id, *[, team_id, ...])

Update a scheduled game via the teams schedule-game endpoint.

update_practice(session, occurrence_id, *[, ...])

Update a practice occurrence.

update_schedule_game_raw(session, game_id, ...)

Execute raw HTTP PUT request to update a scheduled game via PUT /api/schedule-game/{game_id}.

update_team(session, team_id, *[, ...])

Update an existing team's metadata.

upload_team_image(session, image_path[, ...])

Upload an image to Cloudflare via the Teams upload URL endpoint.

validate_game_type(game_type)

Validate a game type against known valid types.

Classes

CalendarEventCreated

Details of a newly created or updated calendar event or practice.

CalendarSubscription

Calendar subscription URLs for Apple Calendar, Google Calendar, and webcal.

CreatedGameResult

Result of creating a scheduled game.

LookupValue

A single value within a lookup category.

PenaltyCode

A penalty code configured for a season.

ScheduleDeleteResult

Result returned from a schedule deletion operation.

ScheduleEvent

Calendar event or scheduled activity for a team.

ScheduleEventDetail

Detailed metadata for a calendar event occurrence.

SeasonDetail

Detailed season metadata with penaltyCodes and teams excluded.

SeasonSummary

Summary of a season for list views.

SeasonTeam

A team participating in a season.

TeamDetail

Detailed information for a single team.

TeamSummary

Summary of a team for list views.

TeamsAuthenticatedSession

Teams-pillar session that refreshes via the teams API gateway.

TeamsLoginFlow

HTTP-based LoginFlow for the teams dashboard.

UpdatedGameResult

Result of updating a scheduled game.

class gamesheet_sdk.teams.CalendarEventCreated[source]ΒΆ

Bases: BaseModel

Details of a newly created or updated calendar event or practice.

idΒΆ

Event identifier.

Type:

str | int | None

event_idΒΆ

Parent event identifier.

Type:

str | int | None

team_idΒΆ

Team identifier.

Type:

int | str | None

prototeam_idΒΆ

Prototeam UUID.

Type:

str | None

titleΒΆ

Event title.

Type:

str | None

typeΒΆ

Event type (β€˜event’ or β€˜practice’).

Type:

str | None

notesΒΆ

Event notes / description.

Type:

str | None

location_nameΒΆ

Location or venue name.

Type:

str | None

location_addressΒΆ

Location address.

Type:

str | None

location_surfaceΒΆ

Location surface.

Type:

str | None

timezone_nameΒΆ

Timezone name.

Type:

str | None

all_dayΒΆ

Whether the event is all day.

Type:

bool | None

is_overrideΒΆ

Whether this occurrence is an override.

Type:

bool | None

original_start_dateΒΆ

Original start date if override.

Type:

str | None

rruleΒΆ

Recurrence rule string.

Type:

str | None

start_dateΒΆ

Start date/time ISO string.

Type:

str | None

end_dateΒΆ

End date/time ISO string.

Type:

str | None

start_timeΒΆ

Start time.

Type:

str | None

end_timeΒΆ

End time.

Type:

str | None

created_by_user_idΒΆ

Creator user identifier.

Type:

int | str | None

created_atΒΆ

Timestamp when created.

Type:

str | None

updated_atΒΆ

Timestamp when updated.

Type:

str | None

deleted_atΒΆ

Timestamp when deleted.

Type:

str | None

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

model_config = {'extra': 'allow'}ΒΆ

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

id: str | int | NoneΒΆ
event_id: str | int | NoneΒΆ
team_id: int | str | NoneΒΆ
prototeam_id: str | NoneΒΆ
title: str | NoneΒΆ
type: str | NoneΒΆ
notes: str | NoneΒΆ
location_name: str | NoneΒΆ
location_address: str | NoneΒΆ
location_surface: str | NoneΒΆ
timezone_name: str | NoneΒΆ
all_day: bool | NoneΒΆ
is_override: bool | NoneΒΆ
original_start_date: str | NoneΒΆ
rrule: str | NoneΒΆ
start_date: str | NoneΒΆ
end_date: str | NoneΒΆ
start_time: str | NoneΒΆ
end_time: str | NoneΒΆ
created_by_user_id: int | str | NoneΒΆ
created_at: str | NoneΒΆ
updated_at: str | NoneΒΆ
deleted_at: str | NoneΒΆ
__init__(**data)ΒΆ

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

classmethod construct(_fields_set=None, **values)ΒΆ
Return type:

Self

copy(*, include=None, exclude=None, update=None, deep=False)ΒΆ

Returns a copy of the model.

!!! warning β€œDeprecated”

This method is now deprecated; use model_copy instead.

If you need include or exclude, use:

`python {test="skip" lint="skip"} data = self.model_dump(include=include, exclude=exclude, round_trip=True) data = {**data, **(update or {})} copied = self.model_validate(data) `

Parameters:
  • include (AbstractSetIntStr | MappingIntStrAny | None) – Optional set or mapping specifying which fields to include in the copied model.

  • exclude (AbstractSetIntStr | MappingIntStrAny | None) – Optional set or mapping specifying which fields to exclude in the copied model.

  • update (Dict[str, Any] | None) – Optional dictionary of field-value pairs to override field values in the copied model.

  • deep (bool) – If True, the values of fields that are Pydantic models will be deep-copied.

Returns:

A copy of the model with included, excluded and updated fields as specified.

Return type:

Self

dict(*, include=None, exclude=None, by_alias=False, exclude_unset=False, exclude_defaults=False, exclude_none=False)ΒΆ
Return type:

Dict[str, Any]

classmethod from_orm(obj)ΒΆ
Return type:

Self

json(*, include=None, exclude=None, by_alias=False, exclude_unset=False, exclude_defaults=False, exclude_none=False, encoder=PydanticUndefined, models_as_dict=PydanticUndefined, **dumps_kwargs)ΒΆ
Return type:

str

model_computed_fields = {}ΒΆ
classmethod model_construct(_fields_set=None, **values)ΒΆ

Creates a new instance of the Model class with validated data.

Creates a new model setting __dict__ and __pydantic_fields_set__ from trusted or pre-validated data. Default values are respected, but no other validation is performed.

!!! note

model_construct() generally respects the model_config.extra setting on the provided model. That is, if model_config.extra == β€˜allow’, then all extra passed values are added to the model instance’s __dict__ and __pydantic_extra__ fields. If model_config.extra == β€˜ignore’ (the default), then all extra passed values are ignored. Because no validation is performed with a call to model_construct(), having model_config.extra == β€˜forbid’ does not result in an error if extra values are passed, but they will be ignored.

Parameters:
  • _fields_set (set[str] | None) – A set of field names that were originally explicitly set during instantiation. If provided, this is directly used for the [model_fields_set][pydantic.BaseModel.model_fields_set] attribute. Otherwise, the field names from the values argument will be used.

  • values (Any) – Trusted or pre-validated data dictionary.

Returns:

A new instance of the Model class with validated data.

Return type:

Self

model_copy(*, update=None, deep=False)ΒΆ
!!! abstract β€œUsage Documentation”

[model_copy](../concepts/models.md#model-copy)

Returns a copy of the model.

!!! note

The underlying instance’s [__dict__][object.__dict__] attribute is copied. This might have unexpected side effects if you store anything in it, on top of the model fields (e.g. the value of [cached properties][functools.cached_property]).

Parameters:
  • update (Mapping[str, Any] | None) – Values to change/add in the new model. Note: the data is not validated before creating the new model. You should trust this data.

  • deep (bool) – Set to True to make a deep copy of the model.

Returns:

New model instance.

Return type:

Self

model_dump(*, mode='python', include=None, exclude=None, context=None, by_alias=None, exclude_unset=False, exclude_defaults=False, exclude_none=False, exclude_computed_fields=False, round_trip=False, warnings=True, fallback=None, serialize_as_any=False, polymorphic_serialization=None)ΒΆ
!!! abstract β€œUsage Documentation”

[model_dump](../concepts/serialization.md#python-mode)

Generate a dictionary representation of the model, optionally specifying which fields to include or exclude.

Parameters:
  • mode (Literal['json', 'python'] | str) – The mode in which to_python should run. If mode is β€˜json’, the output will only contain JSON serializable types. If mode is β€˜python’, the output may contain non-JSON-serializable Python objects.

  • include (set[int] | set[str] | Mapping[int, set[int] | set[str] | Mapping[int, IncEx | bool] | Mapping[str, IncEx | bool] | bool] | Mapping[str, set[int] | set[str] | Mapping[int, IncEx | bool] | Mapping[str, IncEx | bool] | bool] | None) – A set of fields to include in the output.

  • exclude (set[int] | set[str] | Mapping[int, set[int] | set[str] | Mapping[int, IncEx | bool] | Mapping[str, IncEx | bool] | bool] | Mapping[str, set[int] | set[str] | Mapping[int, IncEx | bool] | Mapping[str, IncEx | bool] | bool] | None) – A set of fields to exclude from the output.

  • context (Any | None) – Additional context to pass to the serializer.

  • by_alias (bool | None) – Whether to use the field’s alias in the dictionary key if defined.

  • exclude_unset (bool) – Whether to exclude fields that have not been explicitly set.

  • exclude_defaults (bool) – Whether to exclude fields that are set to their default value.

  • exclude_none (bool) – Whether to exclude fields that have a value of None.

  • exclude_computed_fields (bool) – Whether to exclude computed fields. While this can be useful for round-tripping, it is usually recommended to use the dedicated round_trip parameter instead.

  • round_trip (bool) – If True, dumped values should be valid as input for non-idempotent types such as Json[T].

  • warnings (bool | Literal['none', 'warn', 'error']) – How to handle serialization errors. False/”none” ignores them, True/”warn” logs errors, β€œerror” raises a [PydanticSerializationError][pydantic_core.PydanticSerializationError].

  • fallback (Callable[[Any], Any] | None) – A function to call when an unknown value is encountered. If not provided, a [PydanticSerializationError][pydantic_core.PydanticSerializationError] error is raised.

  • serialize_as_any (bool) – Whether to serialize fields with duck-typing serialization behavior.

  • polymorphic_serialization (bool | None) – Whether to use model and dataclass polymorphic serialization for this call.

Returns:

A dictionary representation of the model.

Return type:

dict[str, Any]

model_dump_json(*, indent=None, ensure_ascii=False, include=None, exclude=None, context=None, by_alias=None, exclude_unset=False, exclude_defaults=False, exclude_none=False, exclude_computed_fields=False, round_trip=False, warnings=True, fallback=None, serialize_as_any=False, polymorphic_serialization=None)ΒΆ
!!! abstract β€œUsage Documentation”

[model_dump_json](../concepts/serialization.md#json-mode)

Generates a JSON representation of the model using Pydantic’s to_json method.

Parameters:
  • indent (int | None) – Indentation to use in the JSON output. If None is passed, the output will be compact.

  • ensure_ascii (bool) – If True, the output is guaranteed to have all incoming non-ASCII characters escaped. If False (the default), these characters will be output as-is.

  • include (set[int] | set[str] | Mapping[int, set[int] | set[str] | Mapping[int, IncEx | bool] | Mapping[str, IncEx | bool] | bool] | Mapping[str, set[int] | set[str] | Mapping[int, IncEx | bool] | Mapping[str, IncEx | bool] | bool] | None) – Field(s) to include in the JSON output.

  • exclude (set[int] | set[str] | Mapping[int, set[int] | set[str] | Mapping[int, IncEx | bool] | Mapping[str, IncEx | bool] | bool] | Mapping[str, set[int] | set[str] | Mapping[int, IncEx | bool] | Mapping[str, IncEx | bool] | bool] | None) – Field(s) to exclude from the JSON output.

  • context (Any | None) – Additional context to pass to the serializer.

  • by_alias (bool | None) – Whether to serialize using field aliases.

  • exclude_unset (bool) – Whether to exclude fields that have not been explicitly set.

  • exclude_defaults (bool) – Whether to exclude fields that are set to their default value.

  • exclude_none (bool) – Whether to exclude fields that have a value of None.

  • exclude_computed_fields (bool) – Whether to exclude computed fields. While this can be useful for round-tripping, it is usually recommended to use the dedicated round_trip parameter instead.

  • round_trip (bool) – If True, dumped values should be valid as input for non-idempotent types such as Json[T].

  • warnings (bool | Literal['none', 'warn', 'error']) – How to handle serialization errors. False/”none” ignores them, True/”warn” logs errors, β€œerror” raises a [PydanticSerializationError][pydantic_core.PydanticSerializationError].

  • fallback (Callable[[Any], Any] | None) – A function to call when an unknown value is encountered. If not provided, a [PydanticSerializationError][pydantic_core.PydanticSerializationError] error is raised.

  • serialize_as_any (bool) – Whether to serialize fields with duck-typing serialization behavior.

  • polymorphic_serialization (bool | None) – Whether to use model and dataclass polymorphic serialization for this call.

Returns:

A JSON string representation of the model.

Return type:

str

property model_extra: dict[str, Any] | NoneΒΆ

Get extra fields set during validation.

Returns:

A dictionary of extra fields, or None if config.extra is not set to β€œallow”.

model_fields = {'all_day': FieldInfo(annotation=Union[bool, NoneType], required=False, default=None, description='Whether the event is all day.'), 'created_at': FieldInfo(annotation=Union[str, NoneType], required=False, default=None, description='Timestamp when created.'), 'created_by_user_id': FieldInfo(annotation=Union[int, str, NoneType], required=False, default=None, description='Creator user identifier.'), 'deleted_at': FieldInfo(annotation=Union[str, NoneType], required=False, default=None, description='Timestamp when deleted.'), 'end_date': FieldInfo(annotation=Union[str, NoneType], required=False, default=None, description='End date/time ISO string.'), 'end_time': FieldInfo(annotation=Union[str, NoneType], required=False, default=None, description='End time.'), 'event_id': FieldInfo(annotation=Union[str, int, NoneType], required=False, default=None, description='Parent event identifier.'), 'id': FieldInfo(annotation=Union[str, int, NoneType], required=False, default=None, description='Event identifier.'), 'is_override': FieldInfo(annotation=Union[bool, NoneType], required=False, default=None, description='Whether this occurrence is an override.'), 'location_address': FieldInfo(annotation=Union[str, NoneType], required=False, default=None, description='Location address.'), 'location_name': FieldInfo(annotation=Union[str, NoneType], required=False, default=None, description='Location or venue name.'), 'location_surface': FieldInfo(annotation=Union[str, NoneType], required=False, default=None, description='Location surface.'), 'notes': FieldInfo(annotation=Union[str, NoneType], required=False, default=None, description='Event notes or description.'), 'original_start_date': FieldInfo(annotation=Union[str, NoneType], required=False, default=None, description='Original start date if override.'), 'prototeam_id': FieldInfo(annotation=Union[str, NoneType], required=False, default=None, description='Prototeam UUID.'), 'rrule': FieldInfo(annotation=Union[str, NoneType], required=False, default=None, description='Recurrence rule string.'), 'start_date': FieldInfo(annotation=Union[str, NoneType], required=False, default=None, description='Start date/time ISO string.'), 'start_time': FieldInfo(annotation=Union[str, NoneType], required=False, default=None, description='Start time.'), 'team_id': FieldInfo(annotation=Union[int, str, NoneType], required=False, default=None, description='Team identifier.'), 'timezone_name': FieldInfo(annotation=Union[str, NoneType], required=False, default=None, description='Timezone name.'), 'title': FieldInfo(annotation=Union[str, NoneType], required=False, default=None, description='Event title.'), 'type': FieldInfo(annotation=Union[str, NoneType], required=False, default=None, description="Event type ('event' or 'practice')."), 'updated_at': FieldInfo(annotation=Union[str, NoneType], required=False, default=None, description='Timestamp when updated.')}ΒΆ
property model_fields_set: set[str]ΒΆ

Returns the set of fields that have been explicitly set on this model instance.

Returns:

A set of strings representing the fields that have been set,

i.e. that were not filled from defaults.

classmethod model_json_schema(by_alias=True, ref_template='#/$defs/{model}', schema_generator=<class 'pydantic.json_schema.GenerateJsonSchema'>, mode='validation', *, union_format='any_of')ΒΆ

Generates a JSON schema for a model class.

Parameters:
  • by_alias (bool) – Whether to use attribute aliases or not.

  • ref_template (str) – The reference template.

  • union_format (Literal['any_of', 'primitive_type_array']) –

    The format to use when combining schemas from unions together. Can be one of:

    keyword to combine schemas (the default). - β€˜primitive_type_array’: Use the [type](https://json-schema.org/understanding-json-schema/reference/type) keyword as an array of strings, containing each type of the combination. If any of the schemas is not a primitive type (string, boolean, null, integer or number) or contains constraints/metadata, falls back to any_of.

  • schema_generator (type[GenerateJsonSchema]) – To override the logic used to generate the JSON schema, as a subclass of GenerateJsonSchema with your desired modifications

  • mode (Literal['validation', 'serialization']) – The mode in which to generate the schema.

Returns:

The JSON schema for the given model class.

Return type:

dict[str, Any]

classmethod model_parametrized_name(params)ΒΆ

Compute the class name for parametrizations of generic classes.

This method can be overridden to achieve a custom naming scheme for generic BaseModels.

Parameters:

params (tuple[type[Any], ...]) – Tuple of types of the class. Given a generic class Model with 2 type variables and a concrete model Model[str, int], the value (str, int) would be passed to params.

Returns:

String representing the new class where params are passed to cls as type variables.

Raises:

TypeError – Raised when trying to generate concrete names for non-generic models.

Return type:

str

model_post_init(context, /)ΒΆ

Override this method to perform additional initialization after __init__ and model_construct. This is useful if you want to do some validation that requires the entire model to be initialized.

classmethod model_rebuild(*, force=False, raise_errors=True, _parent_namespace_depth=2, _types_namespace=None)ΒΆ

Try to rebuild the pydantic-core schema for the model.

This may be necessary when one of the annotations is a ForwardRef which could not be resolved during the initial attempt to build the schema, and automatic rebuilding fails.

Parameters:
  • force (bool) – Whether to force the rebuilding of the model schema, defaults to False.

  • raise_errors (bool) – Whether to raise errors, defaults to True.

  • _parent_namespace_depth (int) – The depth level of the parent namespace, defaults to 2.

  • _types_namespace (MappingNamespace | None) – The types namespace, defaults to None.

Returns:

Returns None if the schema is already β€œcomplete” and rebuilding was not required. If rebuilding _was_ required, returns True if rebuilding was successful, otherwise False.

Return type:

bool | None

classmethod model_validate(obj, *, strict=None, extra=None, from_attributes=None, context=None, by_alias=None, by_name=None)ΒΆ

Validate a pydantic model instance.

Parameters:
  • obj (Any) – The object to validate.

  • strict (bool | None) – Whether to enforce types strictly.

  • extra (Literal['allow', 'ignore', 'forbid'] | None) – Whether to ignore, allow, or forbid extra data during model validation. See the [extra configuration value][pydantic.ConfigDict.extra] for details.

  • from_attributes (bool | None) – Whether to extract data from object attributes.

  • context (Any | None) – Additional context to pass to the validator.

  • by_alias (bool | None) – Whether to use the field’s alias when validating against the provided input data.

  • by_name (bool | None) – Whether to use the field’s name when validating against the provided input data.

Raises:

ValidationError – If the object could not be validated.

Returns:

The validated model instance.

Return type:

Self

classmethod model_validate_json(json_data, *, strict=None, extra=None, context=None, by_alias=None, by_name=None)ΒΆ
!!! abstract β€œUsage Documentation”

[JSON Parsing](../concepts/json.md#json-parsing)

Validate the given JSON data against the Pydantic model.

Parameters:
  • json_data (str | bytes | bytearray) – The JSON data to validate.

  • strict (bool | None) – Whether to enforce types strictly.

  • extra (Literal['allow', 'ignore', 'forbid'] | None) – Whether to ignore, allow, or forbid extra data during model validation. See the [extra configuration value][pydantic.ConfigDict.extra] for details.

  • context (Any | None) – Extra variables to pass to the validator.

  • by_alias (bool | None) – Whether to use the field’s alias when validating against the provided input data.

  • by_name (bool | None) – Whether to use the field’s name when validating against the provided input data.

Returns:

The validated Pydantic model.

Raises:

ValidationError – If json_data is not a JSON string or the object could not be validated.

Return type:

Self

classmethod model_validate_strings(obj, *, strict=None, extra=None, context=None, by_alias=None, by_name=None)ΒΆ

Validate the given object with string data against the Pydantic model.

Parameters:
  • obj (Any) – The object containing string data to validate.

  • strict (bool | None) – Whether to enforce types strictly.

  • extra (Literal['allow', 'ignore', 'forbid'] | None) – Whether to ignore, allow, or forbid extra data during model validation. See the [extra configuration value][pydantic.ConfigDict.extra] for details.

  • context (Any | None) – Extra variables to pass to the validator.

  • by_alias (bool | None) – Whether to use the field’s alias when validating against the provided input data.

  • by_name (bool | None) – Whether to use the field’s name when validating against the provided input data.

Returns:

The validated Pydantic model.

Return type:

Self

classmethod parse_file(path, *, content_type=None, encoding='utf8', proto=None, allow_pickle=False)ΒΆ
Return type:

Self

classmethod parse_obj(obj)ΒΆ
Return type:

Self

classmethod parse_raw(b, *, content_type=None, encoding='utf8', proto=None, allow_pickle=False)ΒΆ
Return type:

Self

classmethod schema(by_alias=True, ref_template='#/$defs/{model}')ΒΆ
Return type:

Dict[str, Any]

classmethod schema_json(*, by_alias=True, ref_template='#/$defs/{model}', **dumps_kwargs)ΒΆ
Return type:

str

classmethod update_forward_refs(**localns)ΒΆ
classmethod validate(value)ΒΆ
Return type:

Self

class gamesheet_sdk.teams.CalendarSubscription[source]ΒΆ

Bases: BaseModel

Calendar subscription URLs for Apple Calendar, Google Calendar, and webcal.

appleCalendarΒΆ

Apple Calendar subscription URL (webcal protocol).

Type:

str

googleCalendarΒΆ

Google Calendar subscription URL.

Type:

str

calendarUrlΒΆ

Generic calendar subscription feed URL (webcal protocol).

Type:

str

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

model_config = {'extra': 'allow'}ΒΆ

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

appleCalendar: strΒΆ
googleCalendar: strΒΆ
calendarUrl: strΒΆ
__init__(**data)ΒΆ

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

classmethod construct(_fields_set=None, **values)ΒΆ
Return type:

Self

copy(*, include=None, exclude=None, update=None, deep=False)ΒΆ

Returns a copy of the model.

!!! warning β€œDeprecated”

This method is now deprecated; use model_copy instead.

If you need include or exclude, use:

`python {test="skip" lint="skip"} data = self.model_dump(include=include, exclude=exclude, round_trip=True) data = {**data, **(update or {})} copied = self.model_validate(data) `

Parameters:
  • include (AbstractSetIntStr | MappingIntStrAny | None) – Optional set or mapping specifying which fields to include in the copied model.

  • exclude (AbstractSetIntStr | MappingIntStrAny | None) – Optional set or mapping specifying which fields to exclude in the copied model.

  • update (Dict[str, Any] | None) – Optional dictionary of field-value pairs to override field values in the copied model.

  • deep (bool) – If True, the values of fields that are Pydantic models will be deep-copied.

Returns:

A copy of the model with included, excluded and updated fields as specified.

Return type:

Self

dict(*, include=None, exclude=None, by_alias=False, exclude_unset=False, exclude_defaults=False, exclude_none=False)ΒΆ
Return type:

Dict[str, Any]

classmethod from_orm(obj)ΒΆ
Return type:

Self

json(*, include=None, exclude=None, by_alias=False, exclude_unset=False, exclude_defaults=False, exclude_none=False, encoder=PydanticUndefined, models_as_dict=PydanticUndefined, **dumps_kwargs)ΒΆ
Return type:

str

model_computed_fields = {}ΒΆ
classmethod model_construct(_fields_set=None, **values)ΒΆ

Creates a new instance of the Model class with validated data.

Creates a new model setting __dict__ and __pydantic_fields_set__ from trusted or pre-validated data. Default values are respected, but no other validation is performed.

!!! note

model_construct() generally respects the model_config.extra setting on the provided model. That is, if model_config.extra == β€˜allow’, then all extra passed values are added to the model instance’s __dict__ and __pydantic_extra__ fields. If model_config.extra == β€˜ignore’ (the default), then all extra passed values are ignored. Because no validation is performed with a call to model_construct(), having model_config.extra == β€˜forbid’ does not result in an error if extra values are passed, but they will be ignored.

Parameters:
  • _fields_set (set[str] | None) – A set of field names that were originally explicitly set during instantiation. If provided, this is directly used for the [model_fields_set][pydantic.BaseModel.model_fields_set] attribute. Otherwise, the field names from the values argument will be used.

  • values (Any) – Trusted or pre-validated data dictionary.

Returns:

A new instance of the Model class with validated data.

Return type:

Self

model_copy(*, update=None, deep=False)ΒΆ
!!! abstract β€œUsage Documentation”

[model_copy](../concepts/models.md#model-copy)

Returns a copy of the model.

!!! note

The underlying instance’s [__dict__][object.__dict__] attribute is copied. This might have unexpected side effects if you store anything in it, on top of the model fields (e.g. the value of [cached properties][functools.cached_property]).

Parameters:
  • update (Mapping[str, Any] | None) – Values to change/add in the new model. Note: the data is not validated before creating the new model. You should trust this data.

  • deep (bool) – Set to True to make a deep copy of the model.

Returns:

New model instance.

Return type:

Self

model_dump(*, mode='python', include=None, exclude=None, context=None, by_alias=None, exclude_unset=False, exclude_defaults=False, exclude_none=False, exclude_computed_fields=False, round_trip=False, warnings=True, fallback=None, serialize_as_any=False, polymorphic_serialization=None)ΒΆ
!!! abstract β€œUsage Documentation”

[model_dump](../concepts/serialization.md#python-mode)

Generate a dictionary representation of the model, optionally specifying which fields to include or exclude.

Parameters:
  • mode (Literal['json', 'python'] | str) – The mode in which to_python should run. If mode is β€˜json’, the output will only contain JSON serializable types. If mode is β€˜python’, the output may contain non-JSON-serializable Python objects.

  • include (set[int] | set[str] | Mapping[int, set[int] | set[str] | Mapping[int, IncEx | bool] | Mapping[str, IncEx | bool] | bool] | Mapping[str, set[int] | set[str] | Mapping[int, IncEx | bool] | Mapping[str, IncEx | bool] | bool] | None) – A set of fields to include in the output.

  • exclude (set[int] | set[str] | Mapping[int, set[int] | set[str] | Mapping[int, IncEx | bool] | Mapping[str, IncEx | bool] | bool] | Mapping[str, set[int] | set[str] | Mapping[int, IncEx | bool] | Mapping[str, IncEx | bool] | bool] | None) – A set of fields to exclude from the output.

  • context (Any | None) – Additional context to pass to the serializer.

  • by_alias (bool | None) – Whether to use the field’s alias in the dictionary key if defined.

  • exclude_unset (bool) – Whether to exclude fields that have not been explicitly set.

  • exclude_defaults (bool) – Whether to exclude fields that are set to their default value.

  • exclude_none (bool) – Whether to exclude fields that have a value of None.

  • exclude_computed_fields (bool) – Whether to exclude computed fields. While this can be useful for round-tripping, it is usually recommended to use the dedicated round_trip parameter instead.

  • round_trip (bool) – If True, dumped values should be valid as input for non-idempotent types such as Json[T].

  • warnings (bool | Literal['none', 'warn', 'error']) – How to handle serialization errors. False/”none” ignores them, True/”warn” logs errors, β€œerror” raises a [PydanticSerializationError][pydantic_core.PydanticSerializationError].

  • fallback (Callable[[Any], Any] | None) – A function to call when an unknown value is encountered. If not provided, a [PydanticSerializationError][pydantic_core.PydanticSerializationError] error is raised.

  • serialize_as_any (bool) – Whether to serialize fields with duck-typing serialization behavior.

  • polymorphic_serialization (bool | None) – Whether to use model and dataclass polymorphic serialization for this call.

Returns:

A dictionary representation of the model.

Return type:

dict[str, Any]

model_dump_json(*, indent=None, ensure_ascii=False, include=None, exclude=None, context=None, by_alias=None, exclude_unset=False, exclude_defaults=False, exclude_none=False, exclude_computed_fields=False, round_trip=False, warnings=True, fallback=None, serialize_as_any=False, polymorphic_serialization=None)ΒΆ
!!! abstract β€œUsage Documentation”

[model_dump_json](../concepts/serialization.md#json-mode)

Generates a JSON representation of the model using Pydantic’s to_json method.

Parameters:
  • indent (int | None) – Indentation to use in the JSON output. If None is passed, the output will be compact.

  • ensure_ascii (bool) – If True, the output is guaranteed to have all incoming non-ASCII characters escaped. If False (the default), these characters will be output as-is.

  • include (set[int] | set[str] | Mapping[int, set[int] | set[str] | Mapping[int, IncEx | bool] | Mapping[str, IncEx | bool] | bool] | Mapping[str, set[int] | set[str] | Mapping[int, IncEx | bool] | Mapping[str, IncEx | bool] | bool] | None) – Field(s) to include in the JSON output.

  • exclude (set[int] | set[str] | Mapping[int, set[int] | set[str] | Mapping[int, IncEx | bool] | Mapping[str, IncEx | bool] | bool] | Mapping[str, set[int] | set[str] | Mapping[int, IncEx | bool] | Mapping[str, IncEx | bool] | bool] | None) – Field(s) to exclude from the JSON output.

  • context (Any | None) – Additional context to pass to the serializer.

  • by_alias (bool | None) – Whether to serialize using field aliases.

  • exclude_unset (bool) – Whether to exclude fields that have not been explicitly set.

  • exclude_defaults (bool) – Whether to exclude fields that are set to their default value.

  • exclude_none (bool) – Whether to exclude fields that have a value of None.

  • exclude_computed_fields (bool) – Whether to exclude computed fields. While this can be useful for round-tripping, it is usually recommended to use the dedicated round_trip parameter instead.

  • round_trip (bool) – If True, dumped values should be valid as input for non-idempotent types such as Json[T].

  • warnings (bool | Literal['none', 'warn', 'error']) – How to handle serialization errors. False/”none” ignores them, True/”warn” logs errors, β€œerror” raises a [PydanticSerializationError][pydantic_core.PydanticSerializationError].

  • fallback (Callable[[Any], Any] | None) – A function to call when an unknown value is encountered. If not provided, a [PydanticSerializationError][pydantic_core.PydanticSerializationError] error is raised.

  • serialize_as_any (bool) – Whether to serialize fields with duck-typing serialization behavior.

  • polymorphic_serialization (bool | None) – Whether to use model and dataclass polymorphic serialization for this call.

Returns:

A JSON string representation of the model.

Return type:

str

property model_extra: dict[str, Any] | NoneΒΆ

Get extra fields set during validation.

Returns:

A dictionary of extra fields, or None if config.extra is not set to β€œallow”.

model_fields = {'appleCalendar': FieldInfo(annotation=str, required=False, default='', description='Apple Calendar subscription URL (webcal protocol).'), 'calendarUrl': FieldInfo(annotation=str, required=False, default='', description='Generic calendar subscription feed URL (webcal protocol).'), 'googleCalendar': FieldInfo(annotation=str, required=False, default='', description='Google Calendar subscription URL.')}ΒΆ
property model_fields_set: set[str]ΒΆ

Returns the set of fields that have been explicitly set on this model instance.

Returns:

A set of strings representing the fields that have been set,

i.e. that were not filled from defaults.

classmethod model_json_schema(by_alias=True, ref_template='#/$defs/{model}', schema_generator=<class 'pydantic.json_schema.GenerateJsonSchema'>, mode='validation', *, union_format='any_of')ΒΆ

Generates a JSON schema for a model class.

Parameters:
  • by_alias (bool) – Whether to use attribute aliases or not.

  • ref_template (str) – The reference template.

  • union_format (Literal['any_of', 'primitive_type_array']) –

    The format to use when combining schemas from unions together. Can be one of:

    keyword to combine schemas (the default). - β€˜primitive_type_array’: Use the [type](https://json-schema.org/understanding-json-schema/reference/type) keyword as an array of strings, containing each type of the combination. If any of the schemas is not a primitive type (string, boolean, null, integer or number) or contains constraints/metadata, falls back to any_of.

  • schema_generator (type[GenerateJsonSchema]) – To override the logic used to generate the JSON schema, as a subclass of GenerateJsonSchema with your desired modifications

  • mode (Literal['validation', 'serialization']) – The mode in which to generate the schema.

Returns:

The JSON schema for the given model class.

Return type:

dict[str, Any]

classmethod model_parametrized_name(params)ΒΆ

Compute the class name for parametrizations of generic classes.

This method can be overridden to achieve a custom naming scheme for generic BaseModels.

Parameters:

params (tuple[type[Any], ...]) – Tuple of types of the class. Given a generic class Model with 2 type variables and a concrete model Model[str, int], the value (str, int) would be passed to params.

Returns:

String representing the new class where params are passed to cls as type variables.

Raises:

TypeError – Raised when trying to generate concrete names for non-generic models.

Return type:

str

model_post_init(context, /)ΒΆ

Override this method to perform additional initialization after __init__ and model_construct. This is useful if you want to do some validation that requires the entire model to be initialized.

classmethod model_rebuild(*, force=False, raise_errors=True, _parent_namespace_depth=2, _types_namespace=None)ΒΆ

Try to rebuild the pydantic-core schema for the model.

This may be necessary when one of the annotations is a ForwardRef which could not be resolved during the initial attempt to build the schema, and automatic rebuilding fails.

Parameters:
  • force (bool) – Whether to force the rebuilding of the model schema, defaults to False.

  • raise_errors (bool) – Whether to raise errors, defaults to True.

  • _parent_namespace_depth (int) – The depth level of the parent namespace, defaults to 2.

  • _types_namespace (MappingNamespace | None) – The types namespace, defaults to None.

Returns:

Returns None if the schema is already β€œcomplete” and rebuilding was not required. If rebuilding _was_ required, returns True if rebuilding was successful, otherwise False.

Return type:

bool | None

classmethod model_validate(obj, *, strict=None, extra=None, from_attributes=None, context=None, by_alias=None, by_name=None)ΒΆ

Validate a pydantic model instance.

Parameters:
  • obj (Any) – The object to validate.

  • strict (bool | None) – Whether to enforce types strictly.

  • extra (Literal['allow', 'ignore', 'forbid'] | None) – Whether to ignore, allow, or forbid extra data during model validation. See the [extra configuration value][pydantic.ConfigDict.extra] for details.

  • from_attributes (bool | None) – Whether to extract data from object attributes.

  • context (Any | None) – Additional context to pass to the validator.

  • by_alias (bool | None) – Whether to use the field’s alias when validating against the provided input data.

  • by_name (bool | None) – Whether to use the field’s name when validating against the provided input data.

Raises:

ValidationError – If the object could not be validated.

Returns:

The validated model instance.

Return type:

Self

classmethod model_validate_json(json_data, *, strict=None, extra=None, context=None, by_alias=None, by_name=None)ΒΆ
!!! abstract β€œUsage Documentation”

[JSON Parsing](../concepts/json.md#json-parsing)

Validate the given JSON data against the Pydantic model.

Parameters:
  • json_data (str | bytes | bytearray) – The JSON data to validate.

  • strict (bool | None) – Whether to enforce types strictly.

  • extra (Literal['allow', 'ignore', 'forbid'] | None) – Whether to ignore, allow, or forbid extra data during model validation. See the [extra configuration value][pydantic.ConfigDict.extra] for details.

  • context (Any | None) – Extra variables to pass to the validator.

  • by_alias (bool | None) – Whether to use the field’s alias when validating against the provided input data.

  • by_name (bool | None) – Whether to use the field’s name when validating against the provided input data.

Returns:

The validated Pydantic model.

Raises:

ValidationError – If json_data is not a JSON string or the object could not be validated.

Return type:

Self

classmethod model_validate_strings(obj, *, strict=None, extra=None, context=None, by_alias=None, by_name=None)ΒΆ

Validate the given object with string data against the Pydantic model.

Parameters:
  • obj (Any) – The object containing string data to validate.

  • strict (bool | None) – Whether to enforce types strictly.

  • extra (Literal['allow', 'ignore', 'forbid'] | None) – Whether to ignore, allow, or forbid extra data during model validation. See the [extra configuration value][pydantic.ConfigDict.extra] for details.

  • context (Any | None) – Extra variables to pass to the validator.

  • by_alias (bool | None) – Whether to use the field’s alias when validating against the provided input data.

  • by_name (bool | None) – Whether to use the field’s name when validating against the provided input data.

Returns:

The validated Pydantic model.

Return type:

Self

classmethod parse_file(path, *, content_type=None, encoding='utf8', proto=None, allow_pickle=False)ΒΆ
Return type:

Self

classmethod parse_obj(obj)ΒΆ
Return type:

Self

classmethod parse_raw(b, *, content_type=None, encoding='utf8', proto=None, allow_pickle=False)ΒΆ
Return type:

Self

classmethod schema(by_alias=True, ref_template='#/$defs/{model}')ΒΆ
Return type:

Dict[str, Any]

classmethod schema_json(*, by_alias=True, ref_template='#/$defs/{model}', **dumps_kwargs)ΒΆ
Return type:

str

classmethod update_forward_refs(**localns)ΒΆ
classmethod validate(value)ΒΆ
Return type:

Self

class gamesheet_sdk.teams.CreatedGameResult[source]ΒΆ

Bases: BaseModel

Result of creating a scheduled game.

successΒΆ

Whether the game creation succeeded.

Type:

bool

game_numberΒΆ

Game number.

Type:

str | None

date_timeΒΆ

Start date and time.

Type:

str | None

end_timeΒΆ

End time.

Type:

str | None

game_typeΒΆ

Game type.

Type:

str | None

locationΒΆ

Game location or venue.

Type:

str | None

team_idΒΆ

Team identifier.

Type:

int | str | None

opposing_team_idΒΆ

Opposing team identifier.

Type:

int | str | None

season_idΒΆ

Season identifier.

Type:

int | str | None

association_idΒΆ

Association identifier.

Type:

int | str | None

league_idΒΆ

League identifier.

Type:

int | str | None

division_idΒΆ

Division identifier.

Type:

int | str | None

opposing_divisionΒΆ

Opposing division identifier.

Type:

int | str | None

home_flagΒΆ

Home team flag.

Type:

bool | None

time_zone_nameΒΆ

IANA time zone name.

Type:

str | None

time_zone_offsetΒΆ

Time zone offset in minutes.

Type:

int | None

scorekeeper_nameΒΆ

Scorekeeper name.

Type:

str | None

scorekeeper_phoneΒΆ

Scorekeeper phone.

Type:

str | None

broadcast_providerΒΆ

Broadcast provider.

Type:

str | None

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

model_config = {'extra': 'allow'}ΒΆ

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

success: boolΒΆ
game_number: str | NoneΒΆ
date_time: str | NoneΒΆ
end_time: str | NoneΒΆ
game_type: str | NoneΒΆ
location: str | NoneΒΆ
team_id: int | str | NoneΒΆ
opposing_team_id: int | str | NoneΒΆ
season_id: int | str | NoneΒΆ
association_id: int | str | NoneΒΆ
league_id: int | str | NoneΒΆ
division_id: int | str | NoneΒΆ
opposing_division: int | str | NoneΒΆ
home_flag: bool | NoneΒΆ
time_zone_name: str | NoneΒΆ
time_zone_offset: int | NoneΒΆ
scorekeeper_name: str | NoneΒΆ
scorekeeper_phone: str | NoneΒΆ
broadcast_provider: str | NoneΒΆ
__init__(**data)ΒΆ

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

classmethod construct(_fields_set=None, **values)ΒΆ
Return type:

Self

copy(*, include=None, exclude=None, update=None, deep=False)ΒΆ

Returns a copy of the model.

!!! warning β€œDeprecated”

This method is now deprecated; use model_copy instead.

If you need include or exclude, use:

`python {test="skip" lint="skip"} data = self.model_dump(include=include, exclude=exclude, round_trip=True) data = {**data, **(update or {})} copied = self.model_validate(data) `

Parameters:
  • include (AbstractSetIntStr | MappingIntStrAny | None) – Optional set or mapping specifying which fields to include in the copied model.

  • exclude (AbstractSetIntStr | MappingIntStrAny | None) – Optional set or mapping specifying which fields to exclude in the copied model.

  • update (Dict[str, Any] | None) – Optional dictionary of field-value pairs to override field values in the copied model.

  • deep (bool) – If True, the values of fields that are Pydantic models will be deep-copied.

Returns:

A copy of the model with included, excluded and updated fields as specified.

Return type:

Self

dict(*, include=None, exclude=None, by_alias=False, exclude_unset=False, exclude_defaults=False, exclude_none=False)ΒΆ
Return type:

Dict[str, Any]

classmethod from_orm(obj)ΒΆ
Return type:

Self

json(*, include=None, exclude=None, by_alias=False, exclude_unset=False, exclude_defaults=False, exclude_none=False, encoder=PydanticUndefined, models_as_dict=PydanticUndefined, **dumps_kwargs)ΒΆ
Return type:

str

model_computed_fields = {}ΒΆ
classmethod model_construct(_fields_set=None, **values)ΒΆ

Creates a new instance of the Model class with validated data.

Creates a new model setting __dict__ and __pydantic_fields_set__ from trusted or pre-validated data. Default values are respected, but no other validation is performed.

!!! note

model_construct() generally respects the model_config.extra setting on the provided model. That is, if model_config.extra == β€˜allow’, then all extra passed values are added to the model instance’s __dict__ and __pydantic_extra__ fields. If model_config.extra == β€˜ignore’ (the default), then all extra passed values are ignored. Because no validation is performed with a call to model_construct(), having model_config.extra == β€˜forbid’ does not result in an error if extra values are passed, but they will be ignored.

Parameters:
  • _fields_set (set[str] | None) – A set of field names that were originally explicitly set during instantiation. If provided, this is directly used for the [model_fields_set][pydantic.BaseModel.model_fields_set] attribute. Otherwise, the field names from the values argument will be used.

  • values (Any) – Trusted or pre-validated data dictionary.

Returns:

A new instance of the Model class with validated data.

Return type:

Self

model_copy(*, update=None, deep=False)ΒΆ
!!! abstract β€œUsage Documentation”

[model_copy](../concepts/models.md#model-copy)

Returns a copy of the model.

!!! note

The underlying instance’s [__dict__][object.__dict__] attribute is copied. This might have unexpected side effects if you store anything in it, on top of the model fields (e.g. the value of [cached properties][functools.cached_property]).

Parameters:
  • update (Mapping[str, Any] | None) – Values to change/add in the new model. Note: the data is not validated before creating the new model. You should trust this data.

  • deep (bool) – Set to True to make a deep copy of the model.

Returns:

New model instance.

Return type:

Self

model_dump(*, mode='python', include=None, exclude=None, context=None, by_alias=None, exclude_unset=False, exclude_defaults=False, exclude_none=False, exclude_computed_fields=False, round_trip=False, warnings=True, fallback=None, serialize_as_any=False, polymorphic_serialization=None)ΒΆ
!!! abstract β€œUsage Documentation”

[model_dump](../concepts/serialization.md#python-mode)

Generate a dictionary representation of the model, optionally specifying which fields to include or exclude.

Parameters:
  • mode (Literal['json', 'python'] | str) – The mode in which to_python should run. If mode is β€˜json’, the output will only contain JSON serializable types. If mode is β€˜python’, the output may contain non-JSON-serializable Python objects.

  • include (set[int] | set[str] | Mapping[int, set[int] | set[str] | Mapping[int, IncEx | bool] | Mapping[str, IncEx | bool] | bool] | Mapping[str, set[int] | set[str] | Mapping[int, IncEx | bool] | Mapping[str, IncEx | bool] | bool] | None) – A set of fields to include in the output.

  • exclude (set[int] | set[str] | Mapping[int, set[int] | set[str] | Mapping[int, IncEx | bool] | Mapping[str, IncEx | bool] | bool] | Mapping[str, set[int] | set[str] | Mapping[int, IncEx | bool] | Mapping[str, IncEx | bool] | bool] | None) – A set of fields to exclude from the output.

  • context (Any | None) – Additional context to pass to the serializer.

  • by_alias (bool | None) – Whether to use the field’s alias in the dictionary key if defined.

  • exclude_unset (bool) – Whether to exclude fields that have not been explicitly set.

  • exclude_defaults (bool) – Whether to exclude fields that are set to their default value.

  • exclude_none (bool) – Whether to exclude fields that have a value of None.

  • exclude_computed_fields (bool) – Whether to exclude computed fields. While this can be useful for round-tripping, it is usually recommended to use the dedicated round_trip parameter instead.

  • round_trip (bool) – If True, dumped values should be valid as input for non-idempotent types such as Json[T].

  • warnings (bool | Literal['none', 'warn', 'error']) – How to handle serialization errors. False/”none” ignores them, True/”warn” logs errors, β€œerror” raises a [PydanticSerializationError][pydantic_core.PydanticSerializationError].

  • fallback (Callable[[Any], Any] | None) – A function to call when an unknown value is encountered. If not provided, a [PydanticSerializationError][pydantic_core.PydanticSerializationError] error is raised.

  • serialize_as_any (bool) – Whether to serialize fields with duck-typing serialization behavior.

  • polymorphic_serialization (bool | None) – Whether to use model and dataclass polymorphic serialization for this call.

Returns:

A dictionary representation of the model.

Return type:

dict[str, Any]

model_dump_json(*, indent=None, ensure_ascii=False, include=None, exclude=None, context=None, by_alias=None, exclude_unset=False, exclude_defaults=False, exclude_none=False, exclude_computed_fields=False, round_trip=False, warnings=True, fallback=None, serialize_as_any=False, polymorphic_serialization=None)ΒΆ
!!! abstract β€œUsage Documentation”

[model_dump_json](../concepts/serialization.md#json-mode)

Generates a JSON representation of the model using Pydantic’s to_json method.

Parameters:
  • indent (int | None) – Indentation to use in the JSON output. If None is passed, the output will be compact.

  • ensure_ascii (bool) – If True, the output is guaranteed to have all incoming non-ASCII characters escaped. If False (the default), these characters will be output as-is.

  • include (set[int] | set[str] | Mapping[int, set[int] | set[str] | Mapping[int, IncEx | bool] | Mapping[str, IncEx | bool] | bool] | Mapping[str, set[int] | set[str] | Mapping[int, IncEx | bool] | Mapping[str, IncEx | bool] | bool] | None) – Field(s) to include in the JSON output.

  • exclude (set[int] | set[str] | Mapping[int, set[int] | set[str] | Mapping[int, IncEx | bool] | Mapping[str, IncEx | bool] | bool] | Mapping[str, set[int] | set[str] | Mapping[int, IncEx | bool] | Mapping[str, IncEx | bool] | bool] | None) – Field(s) to exclude from the JSON output.

  • context (Any | None) – Additional context to pass to the serializer.

  • by_alias (bool | None) – Whether to serialize using field aliases.

  • exclude_unset (bool) – Whether to exclude fields that have not been explicitly set.

  • exclude_defaults (bool) – Whether to exclude fields that are set to their default value.

  • exclude_none (bool) – Whether to exclude fields that have a value of None.

  • exclude_computed_fields (bool) – Whether to exclude computed fields. While this can be useful for round-tripping, it is usually recommended to use the dedicated round_trip parameter instead.

  • round_trip (bool) – If True, dumped values should be valid as input for non-idempotent types such as Json[T].

  • warnings (bool | Literal['none', 'warn', 'error']) – How to handle serialization errors. False/”none” ignores them, True/”warn” logs errors, β€œerror” raises a [PydanticSerializationError][pydantic_core.PydanticSerializationError].

  • fallback (Callable[[Any], Any] | None) – A function to call when an unknown value is encountered. If not provided, a [PydanticSerializationError][pydantic_core.PydanticSerializationError] error is raised.

  • serialize_as_any (bool) – Whether to serialize fields with duck-typing serialization behavior.

  • polymorphic_serialization (bool | None) – Whether to use model and dataclass polymorphic serialization for this call.

Returns:

A JSON string representation of the model.

Return type:

str

property model_extra: dict[str, Any] | NoneΒΆ

Get extra fields set during validation.

Returns:

A dictionary of extra fields, or None if config.extra is not set to β€œallow”.

model_fields = {'association_id': FieldInfo(annotation=Union[int, str, NoneType], required=False, default=None, description='Association identifier.'), 'broadcast_provider': FieldInfo(annotation=Union[str, NoneType], required=False, default=None, description='Broadcast provider.'), 'date_time': FieldInfo(annotation=Union[str, NoneType], required=False, default=None, description='Start date and time.'), 'division_id': FieldInfo(annotation=Union[int, str, NoneType], required=False, default=None, description='Division identifier.'), 'end_time': FieldInfo(annotation=Union[str, NoneType], required=False, default=None, description='End time.'), 'game_number': FieldInfo(annotation=Union[str, NoneType], required=False, default=None, description='Game number.'), 'game_type': FieldInfo(annotation=Union[str, NoneType], required=False, default=None, description='Game type.'), 'home_flag': FieldInfo(annotation=Union[bool, NoneType], required=False, default=None, description='Home team flag.'), 'league_id': FieldInfo(annotation=Union[int, str, NoneType], required=False, default=None, description='League identifier.'), 'location': FieldInfo(annotation=Union[str, NoneType], required=False, default=None, description='Game location or venue.'), 'opposing_division': FieldInfo(annotation=Union[int, str, NoneType], required=False, default=None, description='Opposing division identifier.'), 'opposing_team_id': FieldInfo(annotation=Union[int, str, NoneType], required=False, default=None, description='Opposing team identifier.'), 'scorekeeper_name': FieldInfo(annotation=Union[str, NoneType], required=False, default=None, description='Scorekeeper name.'), 'scorekeeper_phone': FieldInfo(annotation=Union[str, NoneType], required=False, default=None, description='Scorekeeper phone.'), 'season_id': FieldInfo(annotation=Union[int, str, NoneType], required=False, default=None, description='Season identifier.'), 'success': FieldInfo(annotation=bool, required=False, default=True, description='Whether the operation succeeded.'), 'team_id': FieldInfo(annotation=Union[int, str, NoneType], required=False, default=None, description='Team identifier.'), 'time_zone_name': FieldInfo(annotation=Union[str, NoneType], required=False, default=None, description='Time zone name.'), 'time_zone_offset': FieldInfo(annotation=Union[int, NoneType], required=False, default=None, description='Time zone offset.')}ΒΆ
property model_fields_set: set[str]ΒΆ

Returns the set of fields that have been explicitly set on this model instance.

Returns:

A set of strings representing the fields that have been set,

i.e. that were not filled from defaults.

classmethod model_json_schema(by_alias=True, ref_template='#/$defs/{model}', schema_generator=<class 'pydantic.json_schema.GenerateJsonSchema'>, mode='validation', *, union_format='any_of')ΒΆ

Generates a JSON schema for a model class.

Parameters:
  • by_alias (bool) – Whether to use attribute aliases or not.

  • ref_template (str) – The reference template.

  • union_format (Literal['any_of', 'primitive_type_array']) –

    The format to use when combining schemas from unions together. Can be one of:

    keyword to combine schemas (the default). - β€˜primitive_type_array’: Use the [type](https://json-schema.org/understanding-json-schema/reference/type) keyword as an array of strings, containing each type of the combination. If any of the schemas is not a primitive type (string, boolean, null, integer or number) or contains constraints/metadata, falls back to any_of.

  • schema_generator (type[GenerateJsonSchema]) – To override the logic used to generate the JSON schema, as a subclass of GenerateJsonSchema with your desired modifications

  • mode (Literal['validation', 'serialization']) – The mode in which to generate the schema.

Returns:

The JSON schema for the given model class.

Return type:

dict[str, Any]

classmethod model_parametrized_name(params)ΒΆ

Compute the class name for parametrizations of generic classes.

This method can be overridden to achieve a custom naming scheme for generic BaseModels.

Parameters:

params (tuple[type[Any], ...]) – Tuple of types of the class. Given a generic class Model with 2 type variables and a concrete model Model[str, int], the value (str, int) would be passed to params.

Returns:

String representing the new class where params are passed to cls as type variables.

Raises:

TypeError – Raised when trying to generate concrete names for non-generic models.

Return type:

str

model_post_init(context, /)ΒΆ

Override this method to perform additional initialization after __init__ and model_construct. This is useful if you want to do some validation that requires the entire model to be initialized.

classmethod model_rebuild(*, force=False, raise_errors=True, _parent_namespace_depth=2, _types_namespace=None)ΒΆ

Try to rebuild the pydantic-core schema for the model.

This may be necessary when one of the annotations is a ForwardRef which could not be resolved during the initial attempt to build the schema, and automatic rebuilding fails.

Parameters:
  • force (bool) – Whether to force the rebuilding of the model schema, defaults to False.

  • raise_errors (bool) – Whether to raise errors, defaults to True.

  • _parent_namespace_depth (int) – The depth level of the parent namespace, defaults to 2.

  • _types_namespace (MappingNamespace | None) – The types namespace, defaults to None.

Returns:

Returns None if the schema is already β€œcomplete” and rebuilding was not required. If rebuilding _was_ required, returns True if rebuilding was successful, otherwise False.

Return type:

bool | None

classmethod model_validate(obj, *, strict=None, extra=None, from_attributes=None, context=None, by_alias=None, by_name=None)ΒΆ

Validate a pydantic model instance.

Parameters:
  • obj (Any) – The object to validate.

  • strict (bool | None) – Whether to enforce types strictly.

  • extra (Literal['allow', 'ignore', 'forbid'] | None) – Whether to ignore, allow, or forbid extra data during model validation. See the [extra configuration value][pydantic.ConfigDict.extra] for details.

  • from_attributes (bool | None) – Whether to extract data from object attributes.

  • context (Any | None) – Additional context to pass to the validator.

  • by_alias (bool | None) – Whether to use the field’s alias when validating against the provided input data.

  • by_name (bool | None) – Whether to use the field’s name when validating against the provided input data.

Raises:

ValidationError – If the object could not be validated.

Returns:

The validated model instance.

Return type:

Self

classmethod model_validate_json(json_data, *, strict=None, extra=None, context=None, by_alias=None, by_name=None)ΒΆ
!!! abstract β€œUsage Documentation”

[JSON Parsing](../concepts/json.md#json-parsing)

Validate the given JSON data against the Pydantic model.

Parameters:
  • json_data (str | bytes | bytearray) – The JSON data to validate.

  • strict (bool | None) – Whether to enforce types strictly.

  • extra (Literal['allow', 'ignore', 'forbid'] | None) – Whether to ignore, allow, or forbid extra data during model validation. See the [extra configuration value][pydantic.ConfigDict.extra] for details.

  • context (Any | None) – Extra variables to pass to the validator.

  • by_alias (bool | None) – Whether to use the field’s alias when validating against the provided input data.

  • by_name (bool | None) – Whether to use the field’s name when validating against the provided input data.

Returns:

The validated Pydantic model.

Raises:

ValidationError – If json_data is not a JSON string or the object could not be validated.

Return type:

Self

classmethod model_validate_strings(obj, *, strict=None, extra=None, context=None, by_alias=None, by_name=None)ΒΆ

Validate the given object with string data against the Pydantic model.

Parameters:
  • obj (Any) – The object containing string data to validate.

  • strict (bool | None) – Whether to enforce types strictly.

  • extra (Literal['allow', 'ignore', 'forbid'] | None) – Whether to ignore, allow, or forbid extra data during model validation. See the [extra configuration value][pydantic.ConfigDict.extra] for details.

  • context (Any | None) – Extra variables to pass to the validator.

  • by_alias (bool | None) – Whether to use the field’s alias when validating against the provided input data.

  • by_name (bool | None) – Whether to use the field’s name when validating against the provided input data.

Returns:

The validated Pydantic model.

Return type:

Self

classmethod parse_file(path, *, content_type=None, encoding='utf8', proto=None, allow_pickle=False)ΒΆ
Return type:

Self

classmethod parse_obj(obj)ΒΆ
Return type:

Self

classmethod parse_raw(b, *, content_type=None, encoding='utf8', proto=None, allow_pickle=False)ΒΆ
Return type:

Self

classmethod schema(by_alias=True, ref_template='#/$defs/{model}')ΒΆ
Return type:

Dict[str, Any]

classmethod schema_json(*, by_alias=True, ref_template='#/$defs/{model}', **dumps_kwargs)ΒΆ
Return type:

str

classmethod update_forward_refs(**localns)ΒΆ
classmethod validate(value)ΒΆ
Return type:

Self

class gamesheet_sdk.teams.LookupValue[source]ΒΆ

Bases: BaseModel

A single value within a lookup category.

All lookup values carry a key. Most also have a title; the few that don’t (e.g. entitlements) default to "". Category-specific fields (abbr, url, sport, scopes, etc.) are preserved via extra="allow" and appear in model_dump() output.

keyΒΆ

Machine-readable identifier.

Type:

str

titleΒΆ

Human-readable display name.

Type:

str

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

model_config = {'extra': 'allow'}ΒΆ

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

key: strΒΆ
title: strΒΆ
__init__(**data)ΒΆ

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

classmethod construct(_fields_set=None, **values)ΒΆ
Return type:

Self

copy(*, include=None, exclude=None, update=None, deep=False)ΒΆ

Returns a copy of the model.

!!! warning β€œDeprecated”

This method is now deprecated; use model_copy instead.

If you need include or exclude, use:

`python {test="skip" lint="skip"} data = self.model_dump(include=include, exclude=exclude, round_trip=True) data = {**data, **(update or {})} copied = self.model_validate(data) `

Parameters:
  • include (AbstractSetIntStr | MappingIntStrAny | None) – Optional set or mapping specifying which fields to include in the copied model.

  • exclude (AbstractSetIntStr | MappingIntStrAny | None) – Optional set or mapping specifying which fields to exclude in the copied model.

  • update (Dict[str, Any] | None) – Optional dictionary of field-value pairs to override field values in the copied model.

  • deep (bool) – If True, the values of fields that are Pydantic models will be deep-copied.

Returns:

A copy of the model with included, excluded and updated fields as specified.

Return type:

Self

dict(*, include=None, exclude=None, by_alias=False, exclude_unset=False, exclude_defaults=False, exclude_none=False)ΒΆ
Return type:

Dict[str, Any]

classmethod from_orm(obj)ΒΆ
Return type:

Self

json(*, include=None, exclude=None, by_alias=False, exclude_unset=False, exclude_defaults=False, exclude_none=False, encoder=PydanticUndefined, models_as_dict=PydanticUndefined, **dumps_kwargs)ΒΆ
Return type:

str

model_computed_fields = {}ΒΆ
classmethod model_construct(_fields_set=None, **values)ΒΆ

Creates a new instance of the Model class with validated data.

Creates a new model setting __dict__ and __pydantic_fields_set__ from trusted or pre-validated data. Default values are respected, but no other validation is performed.

!!! note

model_construct() generally respects the model_config.extra setting on the provided model. That is, if model_config.extra == β€˜allow’, then all extra passed values are added to the model instance’s __dict__ and __pydantic_extra__ fields. If model_config.extra == β€˜ignore’ (the default), then all extra passed values are ignored. Because no validation is performed with a call to model_construct(), having model_config.extra == β€˜forbid’ does not result in an error if extra values are passed, but they will be ignored.

Parameters:
  • _fields_set (set[str] | None) – A set of field names that were originally explicitly set during instantiation. If provided, this is directly used for the [model_fields_set][pydantic.BaseModel.model_fields_set] attribute. Otherwise, the field names from the values argument will be used.

  • values (Any) – Trusted or pre-validated data dictionary.

Returns:

A new instance of the Model class with validated data.

Return type:

Self

model_copy(*, update=None, deep=False)ΒΆ
!!! abstract β€œUsage Documentation”

[model_copy](../concepts/models.md#model-copy)

Returns a copy of the model.

!!! note

The underlying instance’s [__dict__][object.__dict__] attribute is copied. This might have unexpected side effects if you store anything in it, on top of the model fields (e.g. the value of [cached properties][functools.cached_property]).

Parameters:
  • update (Mapping[str, Any] | None) – Values to change/add in the new model. Note: the data is not validated before creating the new model. You should trust this data.

  • deep (bool) – Set to True to make a deep copy of the model.

Returns:

New model instance.

Return type:

Self

model_dump(*, mode='python', include=None, exclude=None, context=None, by_alias=None, exclude_unset=False, exclude_defaults=False, exclude_none=False, exclude_computed_fields=False, round_trip=False, warnings=True, fallback=None, serialize_as_any=False, polymorphic_serialization=None)ΒΆ
!!! abstract β€œUsage Documentation”

[model_dump](../concepts/serialization.md#python-mode)

Generate a dictionary representation of the model, optionally specifying which fields to include or exclude.

Parameters:
  • mode (Literal['json', 'python'] | str) – The mode in which to_python should run. If mode is β€˜json’, the output will only contain JSON serializable types. If mode is β€˜python’, the output may contain non-JSON-serializable Python objects.

  • include (set[int] | set[str] | Mapping[int, set[int] | set[str] | Mapping[int, IncEx | bool] | Mapping[str, IncEx | bool] | bool] | Mapping[str, set[int] | set[str] | Mapping[int, IncEx | bool] | Mapping[str, IncEx | bool] | bool] | None) – A set of fields to include in the output.

  • exclude (set[int] | set[str] | Mapping[int, set[int] | set[str] | Mapping[int, IncEx | bool] | Mapping[str, IncEx | bool] | bool] | Mapping[str, set[int] | set[str] | Mapping[int, IncEx | bool] | Mapping[str, IncEx | bool] | bool] | None) – A set of fields to exclude from the output.

  • context (Any | None) – Additional context to pass to the serializer.

  • by_alias (bool | None) – Whether to use the field’s alias in the dictionary key if defined.

  • exclude_unset (bool) – Whether to exclude fields that have not been explicitly set.

  • exclude_defaults (bool) – Whether to exclude fields that are set to their default value.

  • exclude_none (bool) – Whether to exclude fields that have a value of None.

  • exclude_computed_fields (bool) – Whether to exclude computed fields. While this can be useful for round-tripping, it is usually recommended to use the dedicated round_trip parameter instead.

  • round_trip (bool) – If True, dumped values should be valid as input for non-idempotent types such as Json[T].

  • warnings (bool | Literal['none', 'warn', 'error']) – How to handle serialization errors. False/”none” ignores them, True/”warn” logs errors, β€œerror” raises a [PydanticSerializationError][pydantic_core.PydanticSerializationError].

  • fallback (Callable[[Any], Any] | None) – A function to call when an unknown value is encountered. If not provided, a [PydanticSerializationError][pydantic_core.PydanticSerializationError] error is raised.

  • serialize_as_any (bool) – Whether to serialize fields with duck-typing serialization behavior.

  • polymorphic_serialization (bool | None) – Whether to use model and dataclass polymorphic serialization for this call.

Returns:

A dictionary representation of the model.

Return type:

dict[str, Any]

model_dump_json(*, indent=None, ensure_ascii=False, include=None, exclude=None, context=None, by_alias=None, exclude_unset=False, exclude_defaults=False, exclude_none=False, exclude_computed_fields=False, round_trip=False, warnings=True, fallback=None, serialize_as_any=False, polymorphic_serialization=None)ΒΆ
!!! abstract β€œUsage Documentation”

[model_dump_json](../concepts/serialization.md#json-mode)

Generates a JSON representation of the model using Pydantic’s to_json method.

Parameters:
  • indent (int | None) – Indentation to use in the JSON output. If None is passed, the output will be compact.

  • ensure_ascii (bool) – If True, the output is guaranteed to have all incoming non-ASCII characters escaped. If False (the default), these characters will be output as-is.

  • include (set[int] | set[str] | Mapping[int, set[int] | set[str] | Mapping[int, IncEx | bool] | Mapping[str, IncEx | bool] | bool] | Mapping[str, set[int] | set[str] | Mapping[int, IncEx | bool] | Mapping[str, IncEx | bool] | bool] | None) – Field(s) to include in the JSON output.

  • exclude (set[int] | set[str] | Mapping[int, set[int] | set[str] | Mapping[int, IncEx | bool] | Mapping[str, IncEx | bool] | bool] | Mapping[str, set[int] | set[str] | Mapping[int, IncEx | bool] | Mapping[str, IncEx | bool] | bool] | None) – Field(s) to exclude from the JSON output.

  • context (Any | None) – Additional context to pass to the serializer.

  • by_alias (bool | None) – Whether to serialize using field aliases.

  • exclude_unset (bool) – Whether to exclude fields that have not been explicitly set.

  • exclude_defaults (bool) – Whether to exclude fields that are set to their default value.

  • exclude_none (bool) – Whether to exclude fields that have a value of None.

  • exclude_computed_fields (bool) – Whether to exclude computed fields. While this can be useful for round-tripping, it is usually recommended to use the dedicated round_trip parameter instead.

  • round_trip (bool) – If True, dumped values should be valid as input for non-idempotent types such as Json[T].

  • warnings (bool | Literal['none', 'warn', 'error']) – How to handle serialization errors. False/”none” ignores them, True/”warn” logs errors, β€œerror” raises a [PydanticSerializationError][pydantic_core.PydanticSerializationError].

  • fallback (Callable[[Any], Any] | None) – A function to call when an unknown value is encountered. If not provided, a [PydanticSerializationError][pydantic_core.PydanticSerializationError] error is raised.

  • serialize_as_any (bool) – Whether to serialize fields with duck-typing serialization behavior.

  • polymorphic_serialization (bool | None) – Whether to use model and dataclass polymorphic serialization for this call.

Returns:

A JSON string representation of the model.

Return type:

str

property model_extra: dict[str, Any] | NoneΒΆ

Get extra fields set during validation.

Returns:

A dictionary of extra fields, or None if config.extra is not set to β€œallow”.

model_fields = {'key': FieldInfo(annotation=str, required=True, description='Machine-readable identifier.'), 'title': FieldInfo(annotation=str, required=False, default='', description='Human-readable display name.')}ΒΆ
property model_fields_set: set[str]ΒΆ

Returns the set of fields that have been explicitly set on this model instance.

Returns:

A set of strings representing the fields that have been set,

i.e. that were not filled from defaults.

classmethod model_json_schema(by_alias=True, ref_template='#/$defs/{model}', schema_generator=<class 'pydantic.json_schema.GenerateJsonSchema'>, mode='validation', *, union_format='any_of')ΒΆ

Generates a JSON schema for a model class.

Parameters:
  • by_alias (bool) – Whether to use attribute aliases or not.

  • ref_template (str) – The reference template.

  • union_format (Literal['any_of', 'primitive_type_array']) –

    The format to use when combining schemas from unions together. Can be one of:

    keyword to combine schemas (the default). - β€˜primitive_type_array’: Use the [type](https://json-schema.org/understanding-json-schema/reference/type) keyword as an array of strings, containing each type of the combination. If any of the schemas is not a primitive type (string, boolean, null, integer or number) or contains constraints/metadata, falls back to any_of.

  • schema_generator (type[GenerateJsonSchema]) – To override the logic used to generate the JSON schema, as a subclass of GenerateJsonSchema with your desired modifications

  • mode (Literal['validation', 'serialization']) – The mode in which to generate the schema.

Returns:

The JSON schema for the given model class.

Return type:

dict[str, Any]

classmethod model_parametrized_name(params)ΒΆ

Compute the class name for parametrizations of generic classes.

This method can be overridden to achieve a custom naming scheme for generic BaseModels.

Parameters:

params (tuple[type[Any], ...]) – Tuple of types of the class. Given a generic class Model with 2 type variables and a concrete model Model[str, int], the value (str, int) would be passed to params.

Returns:

String representing the new class where params are passed to cls as type variables.

Raises:

TypeError – Raised when trying to generate concrete names for non-generic models.

Return type:

str

model_post_init(context, /)ΒΆ

Override this method to perform additional initialization after __init__ and model_construct. This is useful if you want to do some validation that requires the entire model to be initialized.

classmethod model_rebuild(*, force=False, raise_errors=True, _parent_namespace_depth=2, _types_namespace=None)ΒΆ

Try to rebuild the pydantic-core schema for the model.

This may be necessary when one of the annotations is a ForwardRef which could not be resolved during the initial attempt to build the schema, and automatic rebuilding fails.

Parameters:
  • force (bool) – Whether to force the rebuilding of the model schema, defaults to False.

  • raise_errors (bool) – Whether to raise errors, defaults to True.

  • _parent_namespace_depth (int) – The depth level of the parent namespace, defaults to 2.

  • _types_namespace (MappingNamespace | None) – The types namespace, defaults to None.

Returns:

Returns None if the schema is already β€œcomplete” and rebuilding was not required. If rebuilding _was_ required, returns True if rebuilding was successful, otherwise False.

Return type:

bool | None

classmethod model_validate(obj, *, strict=None, extra=None, from_attributes=None, context=None, by_alias=None, by_name=None)ΒΆ

Validate a pydantic model instance.

Parameters:
  • obj (Any) – The object to validate.

  • strict (bool | None) – Whether to enforce types strictly.

  • extra (Literal['allow', 'ignore', 'forbid'] | None) – Whether to ignore, allow, or forbid extra data during model validation. See the [extra configuration value][pydantic.ConfigDict.extra] for details.

  • from_attributes (bool | None) – Whether to extract data from object attributes.

  • context (Any | None) – Additional context to pass to the validator.

  • by_alias (bool | None) – Whether to use the field’s alias when validating against the provided input data.

  • by_name (bool | None) – Whether to use the field’s name when validating against the provided input data.

Raises:

ValidationError – If the object could not be validated.

Returns:

The validated model instance.

Return type:

Self

classmethod model_validate_json(json_data, *, strict=None, extra=None, context=None, by_alias=None, by_name=None)ΒΆ
!!! abstract β€œUsage Documentation”

[JSON Parsing](../concepts/json.md#json-parsing)

Validate the given JSON data against the Pydantic model.

Parameters:
  • json_data (str | bytes | bytearray) – The JSON data to validate.

  • strict (bool | None) – Whether to enforce types strictly.

  • extra (Literal['allow', 'ignore', 'forbid'] | None) – Whether to ignore, allow, or forbid extra data during model validation. See the [extra configuration value][pydantic.ConfigDict.extra] for details.

  • context (Any | None) – Extra variables to pass to the validator.

  • by_alias (bool | None) – Whether to use the field’s alias when validating against the provided input data.

  • by_name (bool | None) – Whether to use the field’s name when validating against the provided input data.

Returns:

The validated Pydantic model.

Raises:

ValidationError – If json_data is not a JSON string or the object could not be validated.

Return type:

Self

classmethod model_validate_strings(obj, *, strict=None, extra=None, context=None, by_alias=None, by_name=None)ΒΆ

Validate the given object with string data against the Pydantic model.

Parameters:
  • obj (Any) – The object containing string data to validate.

  • strict (bool | None) – Whether to enforce types strictly.

  • extra (Literal['allow', 'ignore', 'forbid'] | None) – Whether to ignore, allow, or forbid extra data during model validation. See the [extra configuration value][pydantic.ConfigDict.extra] for details.

  • context (Any | None) – Extra variables to pass to the validator.

  • by_alias (bool | None) – Whether to use the field’s alias when validating against the provided input data.

  • by_name (bool | None) – Whether to use the field’s name when validating against the provided input data.

Returns:

The validated Pydantic model.

Return type:

Self

classmethod parse_file(path, *, content_type=None, encoding='utf8', proto=None, allow_pickle=False)ΒΆ
Return type:

Self

classmethod parse_obj(obj)ΒΆ
Return type:

Self

classmethod parse_raw(b, *, content_type=None, encoding='utf8', proto=None, allow_pickle=False)ΒΆ
Return type:

Self

classmethod schema(by_alias=True, ref_template='#/$defs/{model}')ΒΆ
Return type:

Dict[str, Any]

classmethod schema_json(*, by_alias=True, ref_template='#/$defs/{model}', **dumps_kwargs)ΒΆ
Return type:

str

classmethod update_forward_refs(**localns)ΒΆ
classmethod validate(value)ΒΆ
Return type:

Self

class gamesheet_sdk.teams.PenaltyCode[source]ΒΆ

Bases: BaseModel

A penalty code configured for a season.

codeΒΆ

Penalty code identifier.

Type:

str

nameΒΆ

Penalty name or description.

Type:

str

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

model_config = {'extra': 'allow'}ΒΆ

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

code: strΒΆ
name: strΒΆ
__init__(**data)ΒΆ

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

classmethod construct(_fields_set=None, **values)ΒΆ
Return type:

Self

copy(*, include=None, exclude=None, update=None, deep=False)ΒΆ

Returns a copy of the model.

!!! warning β€œDeprecated”

This method is now deprecated; use model_copy instead.

If you need include or exclude, use:

`python {test="skip" lint="skip"} data = self.model_dump(include=include, exclude=exclude, round_trip=True) data = {**data, **(update or {})} copied = self.model_validate(data) `

Parameters:
  • include (AbstractSetIntStr | MappingIntStrAny | None) – Optional set or mapping specifying which fields to include in the copied model.

  • exclude (AbstractSetIntStr | MappingIntStrAny | None) – Optional set or mapping specifying which fields to exclude in the copied model.

  • update (Dict[str, Any] | None) – Optional dictionary of field-value pairs to override field values in the copied model.

  • deep (bool) – If True, the values of fields that are Pydantic models will be deep-copied.

Returns:

A copy of the model with included, excluded and updated fields as specified.

Return type:

Self

dict(*, include=None, exclude=None, by_alias=False, exclude_unset=False, exclude_defaults=False, exclude_none=False)ΒΆ
Return type:

Dict[str, Any]

classmethod from_orm(obj)ΒΆ
Return type:

Self

json(*, include=None, exclude=None, by_alias=False, exclude_unset=False, exclude_defaults=False, exclude_none=False, encoder=PydanticUndefined, models_as_dict=PydanticUndefined, **dumps_kwargs)ΒΆ
Return type:

str

model_computed_fields = {}ΒΆ
classmethod model_construct(_fields_set=None, **values)ΒΆ

Creates a new instance of the Model class with validated data.

Creates a new model setting __dict__ and __pydantic_fields_set__ from trusted or pre-validated data. Default values are respected, but no other validation is performed.

!!! note

model_construct() generally respects the model_config.extra setting on the provided model. That is, if model_config.extra == β€˜allow’, then all extra passed values are added to the model instance’s __dict__ and __pydantic_extra__ fields. If model_config.extra == β€˜ignore’ (the default), then all extra passed values are ignored. Because no validation is performed with a call to model_construct(), having model_config.extra == β€˜forbid’ does not result in an error if extra values are passed, but they will be ignored.

Parameters:
  • _fields_set (set[str] | None) – A set of field names that were originally explicitly set during instantiation. If provided, this is directly used for the [model_fields_set][pydantic.BaseModel.model_fields_set] attribute. Otherwise, the field names from the values argument will be used.

  • values (Any) – Trusted or pre-validated data dictionary.

Returns:

A new instance of the Model class with validated data.

Return type:

Self

model_copy(*, update=None, deep=False)ΒΆ
!!! abstract β€œUsage Documentation”

[model_copy](../concepts/models.md#model-copy)

Returns a copy of the model.

!!! note

The underlying instance’s [__dict__][object.__dict__] attribute is copied. This might have unexpected side effects if you store anything in it, on top of the model fields (e.g. the value of [cached properties][functools.cached_property]).

Parameters:
  • update (Mapping[str, Any] | None) – Values to change/add in the new model. Note: the data is not validated before creating the new model. You should trust this data.

  • deep (bool) – Set to True to make a deep copy of the model.

Returns:

New model instance.

Return type:

Self

model_dump(*, mode='python', include=None, exclude=None, context=None, by_alias=None, exclude_unset=False, exclude_defaults=False, exclude_none=False, exclude_computed_fields=False, round_trip=False, warnings=True, fallback=None, serialize_as_any=False, polymorphic_serialization=None)ΒΆ
!!! abstract β€œUsage Documentation”

[model_dump](../concepts/serialization.md#python-mode)

Generate a dictionary representation of the model, optionally specifying which fields to include or exclude.

Parameters:
  • mode (Literal['json', 'python'] | str) – The mode in which to_python should run. If mode is β€˜json’, the output will only contain JSON serializable types. If mode is β€˜python’, the output may contain non-JSON-serializable Python objects.

  • include (set[int] | set[str] | Mapping[int, set[int] | set[str] | Mapping[int, IncEx | bool] | Mapping[str, IncEx | bool] | bool] | Mapping[str, set[int] | set[str] | Mapping[int, IncEx | bool] | Mapping[str, IncEx | bool] | bool] | None) – A set of fields to include in the output.

  • exclude (set[int] | set[str] | Mapping[int, set[int] | set[str] | Mapping[int, IncEx | bool] | Mapping[str, IncEx | bool] | bool] | Mapping[str, set[int] | set[str] | Mapping[int, IncEx | bool] | Mapping[str, IncEx | bool] | bool] | None) – A set of fields to exclude from the output.

  • context (Any | None) – Additional context to pass to the serializer.

  • by_alias (bool | None) – Whether to use the field’s alias in the dictionary key if defined.

  • exclude_unset (bool) – Whether to exclude fields that have not been explicitly set.

  • exclude_defaults (bool) – Whether to exclude fields that are set to their default value.

  • exclude_none (bool) – Whether to exclude fields that have a value of None.

  • exclude_computed_fields (bool) – Whether to exclude computed fields. While this can be useful for round-tripping, it is usually recommended to use the dedicated round_trip parameter instead.

  • round_trip (bool) – If True, dumped values should be valid as input for non-idempotent types such as Json[T].

  • warnings (bool | Literal['none', 'warn', 'error']) – How to handle serialization errors. False/”none” ignores them, True/”warn” logs errors, β€œerror” raises a [PydanticSerializationError][pydantic_core.PydanticSerializationError].

  • fallback (Callable[[Any], Any] | None) – A function to call when an unknown value is encountered. If not provided, a [PydanticSerializationError][pydantic_core.PydanticSerializationError] error is raised.

  • serialize_as_any (bool) – Whether to serialize fields with duck-typing serialization behavior.

  • polymorphic_serialization (bool | None) – Whether to use model and dataclass polymorphic serialization for this call.

Returns:

A dictionary representation of the model.

Return type:

dict[str, Any]

model_dump_json(*, indent=None, ensure_ascii=False, include=None, exclude=None, context=None, by_alias=None, exclude_unset=False, exclude_defaults=False, exclude_none=False, exclude_computed_fields=False, round_trip=False, warnings=True, fallback=None, serialize_as_any=False, polymorphic_serialization=None)ΒΆ
!!! abstract β€œUsage Documentation”

[model_dump_json](../concepts/serialization.md#json-mode)

Generates a JSON representation of the model using Pydantic’s to_json method.

Parameters:
  • indent (int | None) – Indentation to use in the JSON output. If None is passed, the output will be compact.

  • ensure_ascii (bool) – If True, the output is guaranteed to have all incoming non-ASCII characters escaped. If False (the default), these characters will be output as-is.

  • include (set[int] | set[str] | Mapping[int, set[int] | set[str] | Mapping[int, IncEx | bool] | Mapping[str, IncEx | bool] | bool] | Mapping[str, set[int] | set[str] | Mapping[int, IncEx | bool] | Mapping[str, IncEx | bool] | bool] | None) – Field(s) to include in the JSON output.

  • exclude (set[int] | set[str] | Mapping[int, set[int] | set[str] | Mapping[int, IncEx | bool] | Mapping[str, IncEx | bool] | bool] | Mapping[str, set[int] | set[str] | Mapping[int, IncEx | bool] | Mapping[str, IncEx | bool] | bool] | None) – Field(s) to exclude from the JSON output.

  • context (Any | None) – Additional context to pass to the serializer.

  • by_alias (bool | None) – Whether to serialize using field aliases.

  • exclude_unset (bool) – Whether to exclude fields that have not been explicitly set.

  • exclude_defaults (bool) – Whether to exclude fields that are set to their default value.

  • exclude_none (bool) – Whether to exclude fields that have a value of None.

  • exclude_computed_fields (bool) – Whether to exclude computed fields. While this can be useful for round-tripping, it is usually recommended to use the dedicated round_trip parameter instead.

  • round_trip (bool) – If True, dumped values should be valid as input for non-idempotent types such as Json[T].

  • warnings (bool | Literal['none', 'warn', 'error']) – How to handle serialization errors. False/”none” ignores them, True/”warn” logs errors, β€œerror” raises a [PydanticSerializationError][pydantic_core.PydanticSerializationError].

  • fallback (Callable[[Any], Any] | None) – A function to call when an unknown value is encountered. If not provided, a [PydanticSerializationError][pydantic_core.PydanticSerializationError] error is raised.

  • serialize_as_any (bool) – Whether to serialize fields with duck-typing serialization behavior.

  • polymorphic_serialization (bool | None) – Whether to use model and dataclass polymorphic serialization for this call.

Returns:

A JSON string representation of the model.

Return type:

str

property model_extra: dict[str, Any] | NoneΒΆ

Get extra fields set during validation.

Returns:

A dictionary of extra fields, or None if config.extra is not set to β€œallow”.

model_fields = {'code': FieldInfo(annotation=str, required=False, default='', description='Penalty code identifier.'), 'name': FieldInfo(annotation=str, required=False, default='', description='Penalty name or description.')}ΒΆ
property model_fields_set: set[str]ΒΆ

Returns the set of fields that have been explicitly set on this model instance.

Returns:

A set of strings representing the fields that have been set,

i.e. that were not filled from defaults.

classmethod model_json_schema(by_alias=True, ref_template='#/$defs/{model}', schema_generator=<class 'pydantic.json_schema.GenerateJsonSchema'>, mode='validation', *, union_format='any_of')ΒΆ

Generates a JSON schema for a model class.

Parameters:
  • by_alias (bool) – Whether to use attribute aliases or not.

  • ref_template (str) – The reference template.

  • union_format (Literal['any_of', 'primitive_type_array']) –

    The format to use when combining schemas from unions together. Can be one of:

    keyword to combine schemas (the default). - β€˜primitive_type_array’: Use the [type](https://json-schema.org/understanding-json-schema/reference/type) keyword as an array of strings, containing each type of the combination. If any of the schemas is not a primitive type (string, boolean, null, integer or number) or contains constraints/metadata, falls back to any_of.

  • schema_generator (type[GenerateJsonSchema]) – To override the logic used to generate the JSON schema, as a subclass of GenerateJsonSchema with your desired modifications

  • mode (Literal['validation', 'serialization']) – The mode in which to generate the schema.

Returns:

The JSON schema for the given model class.

Return type:

dict[str, Any]

classmethod model_parametrized_name(params)ΒΆ

Compute the class name for parametrizations of generic classes.

This method can be overridden to achieve a custom naming scheme for generic BaseModels.

Parameters:

params (tuple[type[Any], ...]) – Tuple of types of the class. Given a generic class Model with 2 type variables and a concrete model Model[str, int], the value (str, int) would be passed to params.

Returns:

String representing the new class where params are passed to cls as type variables.

Raises:

TypeError – Raised when trying to generate concrete names for non-generic models.

Return type:

str

model_post_init(context, /)ΒΆ

Override this method to perform additional initialization after __init__ and model_construct. This is useful if you want to do some validation that requires the entire model to be initialized.

classmethod model_rebuild(*, force=False, raise_errors=True, _parent_namespace_depth=2, _types_namespace=None)ΒΆ

Try to rebuild the pydantic-core schema for the model.

This may be necessary when one of the annotations is a ForwardRef which could not be resolved during the initial attempt to build the schema, and automatic rebuilding fails.

Parameters:
  • force (bool) – Whether to force the rebuilding of the model schema, defaults to False.

  • raise_errors (bool) – Whether to raise errors, defaults to True.

  • _parent_namespace_depth (int) – The depth level of the parent namespace, defaults to 2.

  • _types_namespace (MappingNamespace | None) – The types namespace, defaults to None.

Returns:

Returns None if the schema is already β€œcomplete” and rebuilding was not required. If rebuilding _was_ required, returns True if rebuilding was successful, otherwise False.

Return type:

bool | None

classmethod model_validate(obj, *, strict=None, extra=None, from_attributes=None, context=None, by_alias=None, by_name=None)ΒΆ

Validate a pydantic model instance.

Parameters:
  • obj (Any) – The object to validate.

  • strict (bool | None) – Whether to enforce types strictly.

  • extra (Literal['allow', 'ignore', 'forbid'] | None) – Whether to ignore, allow, or forbid extra data during model validation. See the [extra configuration value][pydantic.ConfigDict.extra] for details.

  • from_attributes (bool | None) – Whether to extract data from object attributes.

  • context (Any | None) – Additional context to pass to the validator.

  • by_alias (bool | None) – Whether to use the field’s alias when validating against the provided input data.

  • by_name (bool | None) – Whether to use the field’s name when validating against the provided input data.

Raises:

ValidationError – If the object could not be validated.

Returns:

The validated model instance.

Return type:

Self

classmethod model_validate_json(json_data, *, strict=None, extra=None, context=None, by_alias=None, by_name=None)ΒΆ
!!! abstract β€œUsage Documentation”

[JSON Parsing](../concepts/json.md#json-parsing)

Validate the given JSON data against the Pydantic model.

Parameters:
  • json_data (str | bytes | bytearray) – The JSON data to validate.

  • strict (bool | None) – Whether to enforce types strictly.

  • extra (Literal['allow', 'ignore', 'forbid'] | None) – Whether to ignore, allow, or forbid extra data during model validation. See the [extra configuration value][pydantic.ConfigDict.extra] for details.

  • context (Any | None) – Extra variables to pass to the validator.

  • by_alias (bool | None) – Whether to use the field’s alias when validating against the provided input data.

  • by_name (bool | None) – Whether to use the field’s name when validating against the provided input data.

Returns:

The validated Pydantic model.

Raises:

ValidationError – If json_data is not a JSON string or the object could not be validated.

Return type:

Self

classmethod model_validate_strings(obj, *, strict=None, extra=None, context=None, by_alias=None, by_name=None)ΒΆ

Validate the given object with string data against the Pydantic model.

Parameters:
  • obj (Any) – The object containing string data to validate.

  • strict (bool | None) – Whether to enforce types strictly.

  • extra (Literal['allow', 'ignore', 'forbid'] | None) – Whether to ignore, allow, or forbid extra data during model validation. See the [extra configuration value][pydantic.ConfigDict.extra] for details.

  • context (Any | None) – Extra variables to pass to the validator.

  • by_alias (bool | None) – Whether to use the field’s alias when validating against the provided input data.

  • by_name (bool | None) – Whether to use the field’s name when validating against the provided input data.

Returns:

The validated Pydantic model.

Return type:

Self

classmethod parse_file(path, *, content_type=None, encoding='utf8', proto=None, allow_pickle=False)ΒΆ
Return type:

Self

classmethod parse_obj(obj)ΒΆ
Return type:

Self

classmethod parse_raw(b, *, content_type=None, encoding='utf8', proto=None, allow_pickle=False)ΒΆ
Return type:

Self

classmethod schema(by_alias=True, ref_template='#/$defs/{model}')ΒΆ
Return type:

Dict[str, Any]

classmethod schema_json(*, by_alias=True, ref_template='#/$defs/{model}', **dumps_kwargs)ΒΆ
Return type:

str

classmethod update_forward_refs(**localns)ΒΆ
classmethod validate(value)ΒΆ
Return type:

Self

class gamesheet_sdk.teams.ScheduleDeleteResult[source]ΒΆ

Bases: BaseModel

Result returned from a schedule deletion operation.

successΒΆ

Whether the deletion succeeded.

Type:

bool

messageΒΆ

Informational message returned by the API or client.

Type:

str

idΒΆ

Optional identifier of the deleted resource.

Type:

str | int | None

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

model_config = {'extra': 'allow'}ΒΆ

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

success: boolΒΆ
message: strΒΆ
id: str | int | NoneΒΆ
__init__(**data)ΒΆ

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

classmethod construct(_fields_set=None, **values)ΒΆ
Return type:

Self

copy(*, include=None, exclude=None, update=None, deep=False)ΒΆ

Returns a copy of the model.

!!! warning β€œDeprecated”

This method is now deprecated; use model_copy instead.

If you need include or exclude, use:

`python {test="skip" lint="skip"} data = self.model_dump(include=include, exclude=exclude, round_trip=True) data = {**data, **(update or {})} copied = self.model_validate(data) `

Parameters:
  • include (AbstractSetIntStr | MappingIntStrAny | None) – Optional set or mapping specifying which fields to include in the copied model.

  • exclude (AbstractSetIntStr | MappingIntStrAny | None) – Optional set or mapping specifying which fields to exclude in the copied model.

  • update (Dict[str, Any] | None) – Optional dictionary of field-value pairs to override field values in the copied model.

  • deep (bool) – If True, the values of fields that are Pydantic models will be deep-copied.

Returns:

A copy of the model with included, excluded and updated fields as specified.

Return type:

Self

dict(*, include=None, exclude=None, by_alias=False, exclude_unset=False, exclude_defaults=False, exclude_none=False)ΒΆ
Return type:

Dict[str, Any]

classmethod from_orm(obj)ΒΆ
Return type:

Self

json(*, include=None, exclude=None, by_alias=False, exclude_unset=False, exclude_defaults=False, exclude_none=False, encoder=PydanticUndefined, models_as_dict=PydanticUndefined, **dumps_kwargs)ΒΆ
Return type:

str

model_computed_fields = {}ΒΆ
classmethod model_construct(_fields_set=None, **values)ΒΆ

Creates a new instance of the Model class with validated data.

Creates a new model setting __dict__ and __pydantic_fields_set__ from trusted or pre-validated data. Default values are respected, but no other validation is performed.

!!! note

model_construct() generally respects the model_config.extra setting on the provided model. That is, if model_config.extra == β€˜allow’, then all extra passed values are added to the model instance’s __dict__ and __pydantic_extra__ fields. If model_config.extra == β€˜ignore’ (the default), then all extra passed values are ignored. Because no validation is performed with a call to model_construct(), having model_config.extra == β€˜forbid’ does not result in an error if extra values are passed, but they will be ignored.

Parameters:
  • _fields_set (set[str] | None) – A set of field names that were originally explicitly set during instantiation. If provided, this is directly used for the [model_fields_set][pydantic.BaseModel.model_fields_set] attribute. Otherwise, the field names from the values argument will be used.

  • values (Any) – Trusted or pre-validated data dictionary.

Returns:

A new instance of the Model class with validated data.

Return type:

Self

model_copy(*, update=None, deep=False)ΒΆ
!!! abstract β€œUsage Documentation”

[model_copy](../concepts/models.md#model-copy)

Returns a copy of the model.

!!! note

The underlying instance’s [__dict__][object.__dict__] attribute is copied. This might have unexpected side effects if you store anything in it, on top of the model fields (e.g. the value of [cached properties][functools.cached_property]).

Parameters:
  • update (Mapping[str, Any] | None) – Values to change/add in the new model. Note: the data is not validated before creating the new model. You should trust this data.

  • deep (bool) – Set to True to make a deep copy of the model.

Returns:

New model instance.

Return type:

Self

model_dump(*, mode='python', include=None, exclude=None, context=None, by_alias=None, exclude_unset=False, exclude_defaults=False, exclude_none=False, exclude_computed_fields=False, round_trip=False, warnings=True, fallback=None, serialize_as_any=False, polymorphic_serialization=None)ΒΆ
!!! abstract β€œUsage Documentation”

[model_dump](../concepts/serialization.md#python-mode)

Generate a dictionary representation of the model, optionally specifying which fields to include or exclude.

Parameters:
  • mode (Literal['json', 'python'] | str) – The mode in which to_python should run. If mode is β€˜json’, the output will only contain JSON serializable types. If mode is β€˜python’, the output may contain non-JSON-serializable Python objects.

  • include (set[int] | set[str] | Mapping[int, set[int] | set[str] | Mapping[int, IncEx | bool] | Mapping[str, IncEx | bool] | bool] | Mapping[str, set[int] | set[str] | Mapping[int, IncEx | bool] | Mapping[str, IncEx | bool] | bool] | None) – A set of fields to include in the output.

  • exclude (set[int] | set[str] | Mapping[int, set[int] | set[str] | Mapping[int, IncEx | bool] | Mapping[str, IncEx | bool] | bool] | Mapping[str, set[int] | set[str] | Mapping[int, IncEx | bool] | Mapping[str, IncEx | bool] | bool] | None) – A set of fields to exclude from the output.

  • context (Any | None) – Additional context to pass to the serializer.

  • by_alias (bool | None) – Whether to use the field’s alias in the dictionary key if defined.

  • exclude_unset (bool) – Whether to exclude fields that have not been explicitly set.

  • exclude_defaults (bool) – Whether to exclude fields that are set to their default value.

  • exclude_none (bool) – Whether to exclude fields that have a value of None.

  • exclude_computed_fields (bool) – Whether to exclude computed fields. While this can be useful for round-tripping, it is usually recommended to use the dedicated round_trip parameter instead.

  • round_trip (bool) – If True, dumped values should be valid as input for non-idempotent types such as Json[T].

  • warnings (bool | Literal['none', 'warn', 'error']) – How to handle serialization errors. False/”none” ignores them, True/”warn” logs errors, β€œerror” raises a [PydanticSerializationError][pydantic_core.PydanticSerializationError].

  • fallback (Callable[[Any], Any] | None) – A function to call when an unknown value is encountered. If not provided, a [PydanticSerializationError][pydantic_core.PydanticSerializationError] error is raised.

  • serialize_as_any (bool) – Whether to serialize fields with duck-typing serialization behavior.

  • polymorphic_serialization (bool | None) – Whether to use model and dataclass polymorphic serialization for this call.

Returns:

A dictionary representation of the model.

Return type:

dict[str, Any]

model_dump_json(*, indent=None, ensure_ascii=False, include=None, exclude=None, context=None, by_alias=None, exclude_unset=False, exclude_defaults=False, exclude_none=False, exclude_computed_fields=False, round_trip=False, warnings=True, fallback=None, serialize_as_any=False, polymorphic_serialization=None)ΒΆ
!!! abstract β€œUsage Documentation”

[model_dump_json](../concepts/serialization.md#json-mode)

Generates a JSON representation of the model using Pydantic’s to_json method.

Parameters:
  • indent (int | None) – Indentation to use in the JSON output. If None is passed, the output will be compact.

  • ensure_ascii (bool) – If True, the output is guaranteed to have all incoming non-ASCII characters escaped. If False (the default), these characters will be output as-is.

  • include (set[int] | set[str] | Mapping[int, set[int] | set[str] | Mapping[int, IncEx | bool] | Mapping[str, IncEx | bool] | bool] | Mapping[str, set[int] | set[str] | Mapping[int, IncEx | bool] | Mapping[str, IncEx | bool] | bool] | None) – Field(s) to include in the JSON output.

  • exclude (set[int] | set[str] | Mapping[int, set[int] | set[str] | Mapping[int, IncEx | bool] | Mapping[str, IncEx | bool] | bool] | Mapping[str, set[int] | set[str] | Mapping[int, IncEx | bool] | Mapping[str, IncEx | bool] | bool] | None) – Field(s) to exclude from the JSON output.

  • context (Any | None) – Additional context to pass to the serializer.

  • by_alias (bool | None) – Whether to serialize using field aliases.

  • exclude_unset (bool) – Whether to exclude fields that have not been explicitly set.

  • exclude_defaults (bool) – Whether to exclude fields that are set to their default value.

  • exclude_none (bool) – Whether to exclude fields that have a value of None.

  • exclude_computed_fields (bool) – Whether to exclude computed fields. While this can be useful for round-tripping, it is usually recommended to use the dedicated round_trip parameter instead.

  • round_trip (bool) – If True, dumped values should be valid as input for non-idempotent types such as Json[T].

  • warnings (bool | Literal['none', 'warn', 'error']) – How to handle serialization errors. False/”none” ignores them, True/”warn” logs errors, β€œerror” raises a [PydanticSerializationError][pydantic_core.PydanticSerializationError].

  • fallback (Callable[[Any], Any] | None) – A function to call when an unknown value is encountered. If not provided, a [PydanticSerializationError][pydantic_core.PydanticSerializationError] error is raised.

  • serialize_as_any (bool) – Whether to serialize fields with duck-typing serialization behavior.

  • polymorphic_serialization (bool | None) – Whether to use model and dataclass polymorphic serialization for this call.

Returns:

A JSON string representation of the model.

Return type:

str

property model_extra: dict[str, Any] | NoneΒΆ

Get extra fields set during validation.

Returns:

A dictionary of extra fields, or None if config.extra is not set to β€œallow”.

model_fields = {'id': FieldInfo(annotation=Union[str, int, NoneType], required=False, default=None, description='Identifier of deleted resource.'), 'message': FieldInfo(annotation=str, required=False, default='', description='Message returned from deletion operation.'), 'success': FieldInfo(annotation=bool, required=False, default=True, description='Whether the deletion was successful.')}ΒΆ
property model_fields_set: set[str]ΒΆ

Returns the set of fields that have been explicitly set on this model instance.

Returns:

A set of strings representing the fields that have been set,

i.e. that were not filled from defaults.

classmethod model_json_schema(by_alias=True, ref_template='#/$defs/{model}', schema_generator=<class 'pydantic.json_schema.GenerateJsonSchema'>, mode='validation', *, union_format='any_of')ΒΆ

Generates a JSON schema for a model class.

Parameters:
  • by_alias (bool) – Whether to use attribute aliases or not.

  • ref_template (str) – The reference template.

  • union_format (Literal['any_of', 'primitive_type_array']) –

    The format to use when combining schemas from unions together. Can be one of:

    keyword to combine schemas (the default). - β€˜primitive_type_array’: Use the [type](https://json-schema.org/understanding-json-schema/reference/type) keyword as an array of strings, containing each type of the combination. If any of the schemas is not a primitive type (string, boolean, null, integer or number) or contains constraints/metadata, falls back to any_of.

  • schema_generator (type[GenerateJsonSchema]) – To override the logic used to generate the JSON schema, as a subclass of GenerateJsonSchema with your desired modifications

  • mode (Literal['validation', 'serialization']) – The mode in which to generate the schema.

Returns:

The JSON schema for the given model class.

Return type:

dict[str, Any]

classmethod model_parametrized_name(params)ΒΆ

Compute the class name for parametrizations of generic classes.

This method can be overridden to achieve a custom naming scheme for generic BaseModels.

Parameters:

params (tuple[type[Any], ...]) – Tuple of types of the class. Given a generic class Model with 2 type variables and a concrete model Model[str, int], the value (str, int) would be passed to params.

Returns:

String representing the new class where params are passed to cls as type variables.

Raises:

TypeError – Raised when trying to generate concrete names for non-generic models.

Return type:

str

model_post_init(context, /)ΒΆ

Override this method to perform additional initialization after __init__ and model_construct. This is useful if you want to do some validation that requires the entire model to be initialized.

classmethod model_rebuild(*, force=False, raise_errors=True, _parent_namespace_depth=2, _types_namespace=None)ΒΆ

Try to rebuild the pydantic-core schema for the model.

This may be necessary when one of the annotations is a ForwardRef which could not be resolved during the initial attempt to build the schema, and automatic rebuilding fails.

Parameters:
  • force (bool) – Whether to force the rebuilding of the model schema, defaults to False.

  • raise_errors (bool) – Whether to raise errors, defaults to True.

  • _parent_namespace_depth (int) – The depth level of the parent namespace, defaults to 2.

  • _types_namespace (MappingNamespace | None) – The types namespace, defaults to None.

Returns:

Returns None if the schema is already β€œcomplete” and rebuilding was not required. If rebuilding _was_ required, returns True if rebuilding was successful, otherwise False.

Return type:

bool | None

classmethod model_validate(obj, *, strict=None, extra=None, from_attributes=None, context=None, by_alias=None, by_name=None)ΒΆ

Validate a pydantic model instance.

Parameters:
  • obj (Any) – The object to validate.

  • strict (bool | None) – Whether to enforce types strictly.

  • extra (Literal['allow', 'ignore', 'forbid'] | None) – Whether to ignore, allow, or forbid extra data during model validation. See the [extra configuration value][pydantic.ConfigDict.extra] for details.

  • from_attributes (bool | None) – Whether to extract data from object attributes.

  • context (Any | None) – Additional context to pass to the validator.

  • by_alias (bool | None) – Whether to use the field’s alias when validating against the provided input data.

  • by_name (bool | None) – Whether to use the field’s name when validating against the provided input data.

Raises:

ValidationError – If the object could not be validated.

Returns:

The validated model instance.

Return type:

Self

classmethod model_validate_json(json_data, *, strict=None, extra=None, context=None, by_alias=None, by_name=None)ΒΆ
!!! abstract β€œUsage Documentation”

[JSON Parsing](../concepts/json.md#json-parsing)

Validate the given JSON data against the Pydantic model.

Parameters:
  • json_data (str | bytes | bytearray) – The JSON data to validate.

  • strict (bool | None) – Whether to enforce types strictly.

  • extra (Literal['allow', 'ignore', 'forbid'] | None) – Whether to ignore, allow, or forbid extra data during model validation. See the [extra configuration value][pydantic.ConfigDict.extra] for details.

  • context (Any | None) – Extra variables to pass to the validator.

  • by_alias (bool | None) – Whether to use the field’s alias when validating against the provided input data.

  • by_name (bool | None) – Whether to use the field’s name when validating against the provided input data.

Returns:

The validated Pydantic model.

Raises:

ValidationError – If json_data is not a JSON string or the object could not be validated.

Return type:

Self

classmethod model_validate_strings(obj, *, strict=None, extra=None, context=None, by_alias=None, by_name=None)ΒΆ

Validate the given object with string data against the Pydantic model.

Parameters:
  • obj (Any) – The object containing string data to validate.

  • strict (bool | None) – Whether to enforce types strictly.

  • extra (Literal['allow', 'ignore', 'forbid'] | None) – Whether to ignore, allow, or forbid extra data during model validation. See the [extra configuration value][pydantic.ConfigDict.extra] for details.

  • context (Any | None) – Extra variables to pass to the validator.

  • by_alias (bool | None) – Whether to use the field’s alias when validating against the provided input data.

  • by_name (bool | None) – Whether to use the field’s name when validating against the provided input data.

Returns:

The validated Pydantic model.

Return type:

Self

classmethod parse_file(path, *, content_type=None, encoding='utf8', proto=None, allow_pickle=False)ΒΆ
Return type:

Self

classmethod parse_obj(obj)ΒΆ
Return type:

Self

classmethod parse_raw(b, *, content_type=None, encoding='utf8', proto=None, allow_pickle=False)ΒΆ
Return type:

Self

classmethod schema(by_alias=True, ref_template='#/$defs/{model}')ΒΆ
Return type:

Dict[str, Any]

classmethod schema_json(*, by_alias=True, ref_template='#/$defs/{model}', **dumps_kwargs)ΒΆ
Return type:

str

classmethod update_forward_refs(**localns)ΒΆ
classmethod validate(value)ΒΆ
Return type:

Self

class gamesheet_sdk.teams.ScheduleEvent[source]ΒΆ

Bases: BaseModel

Calendar event or scheduled activity for a team.

eventDateΒΆ

Date of the event.

Type:

str

eventLocationΒΆ

Location or venue of the event.

Type:

str

eventTimeΒΆ

Scheduled time of the event.

Type:

str

eventTitleΒΆ

Title or summary description of the event.

Type:

str

idΒΆ

Event identifier.

Type:

str | int | None

typeΒΆ

Type of event (e.g., β€˜event’, β€˜game’, β€˜practice’).

Type:

str

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

model_config = {'extra': 'allow'}ΒΆ

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

eventDate: strΒΆ
eventLocation: strΒΆ
eventTime: strΒΆ
eventTitle: strΒΆ
id: str | int | NoneΒΆ
type: strΒΆ
__init__(**data)ΒΆ

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

classmethod construct(_fields_set=None, **values)ΒΆ
Return type:

Self

copy(*, include=None, exclude=None, update=None, deep=False)ΒΆ

Returns a copy of the model.

!!! warning β€œDeprecated”

This method is now deprecated; use model_copy instead.

If you need include or exclude, use:

`python {test="skip" lint="skip"} data = self.model_dump(include=include, exclude=exclude, round_trip=True) data = {**data, **(update or {})} copied = self.model_validate(data) `

Parameters:
  • include (AbstractSetIntStr | MappingIntStrAny | None) – Optional set or mapping specifying which fields to include in the copied model.

  • exclude (AbstractSetIntStr | MappingIntStrAny | None) – Optional set or mapping specifying which fields to exclude in the copied model.

  • update (Dict[str, Any] | None) – Optional dictionary of field-value pairs to override field values in the copied model.

  • deep (bool) – If True, the values of fields that are Pydantic models will be deep-copied.

Returns:

A copy of the model with included, excluded and updated fields as specified.

Return type:

Self

dict(*, include=None, exclude=None, by_alias=False, exclude_unset=False, exclude_defaults=False, exclude_none=False)ΒΆ
Return type:

Dict[str, Any]

classmethod from_orm(obj)ΒΆ
Return type:

Self

json(*, include=None, exclude=None, by_alias=False, exclude_unset=False, exclude_defaults=False, exclude_none=False, encoder=PydanticUndefined, models_as_dict=PydanticUndefined, **dumps_kwargs)ΒΆ
Return type:

str

model_computed_fields = {}ΒΆ
classmethod model_construct(_fields_set=None, **values)ΒΆ

Creates a new instance of the Model class with validated data.

Creates a new model setting __dict__ and __pydantic_fields_set__ from trusted or pre-validated data. Default values are respected, but no other validation is performed.

!!! note

model_construct() generally respects the model_config.extra setting on the provided model. That is, if model_config.extra == β€˜allow’, then all extra passed values are added to the model instance’s __dict__ and __pydantic_extra__ fields. If model_config.extra == β€˜ignore’ (the default), then all extra passed values are ignored. Because no validation is performed with a call to model_construct(), having model_config.extra == β€˜forbid’ does not result in an error if extra values are passed, but they will be ignored.

Parameters:
  • _fields_set (set[str] | None) – A set of field names that were originally explicitly set during instantiation. If provided, this is directly used for the [model_fields_set][pydantic.BaseModel.model_fields_set] attribute. Otherwise, the field names from the values argument will be used.

  • values (Any) – Trusted or pre-validated data dictionary.

Returns:

A new instance of the Model class with validated data.

Return type:

Self

model_copy(*, update=None, deep=False)ΒΆ
!!! abstract β€œUsage Documentation”

[model_copy](../concepts/models.md#model-copy)

Returns a copy of the model.

!!! note

The underlying instance’s [__dict__][object.__dict__] attribute is copied. This might have unexpected side effects if you store anything in it, on top of the model fields (e.g. the value of [cached properties][functools.cached_property]).

Parameters:
  • update (Mapping[str, Any] | None) – Values to change/add in the new model. Note: the data is not validated before creating the new model. You should trust this data.

  • deep (bool) – Set to True to make a deep copy of the model.

Returns:

New model instance.

Return type:

Self

model_dump(*, mode='python', include=None, exclude=None, context=None, by_alias=None, exclude_unset=False, exclude_defaults=False, exclude_none=False, exclude_computed_fields=False, round_trip=False, warnings=True, fallback=None, serialize_as_any=False, polymorphic_serialization=None)ΒΆ
!!! abstract β€œUsage Documentation”

[model_dump](../concepts/serialization.md#python-mode)

Generate a dictionary representation of the model, optionally specifying which fields to include or exclude.

Parameters:
  • mode (Literal['json', 'python'] | str) – The mode in which to_python should run. If mode is β€˜json’, the output will only contain JSON serializable types. If mode is β€˜python’, the output may contain non-JSON-serializable Python objects.

  • include (set[int] | set[str] | Mapping[int, set[int] | set[str] | Mapping[int, IncEx | bool] | Mapping[str, IncEx | bool] | bool] | Mapping[str, set[int] | set[str] | Mapping[int, IncEx | bool] | Mapping[str, IncEx | bool] | bool] | None) – A set of fields to include in the output.

  • exclude (set[int] | set[str] | Mapping[int, set[int] | set[str] | Mapping[int, IncEx | bool] | Mapping[str, IncEx | bool] | bool] | Mapping[str, set[int] | set[str] | Mapping[int, IncEx | bool] | Mapping[str, IncEx | bool] | bool] | None) – A set of fields to exclude from the output.

  • context (Any | None) – Additional context to pass to the serializer.

  • by_alias (bool | None) – Whether to use the field’s alias in the dictionary key if defined.

  • exclude_unset (bool) – Whether to exclude fields that have not been explicitly set.

  • exclude_defaults (bool) – Whether to exclude fields that are set to their default value.

  • exclude_none (bool) – Whether to exclude fields that have a value of None.

  • exclude_computed_fields (bool) – Whether to exclude computed fields. While this can be useful for round-tripping, it is usually recommended to use the dedicated round_trip parameter instead.

  • round_trip (bool) – If True, dumped values should be valid as input for non-idempotent types such as Json[T].

  • warnings (bool | Literal['none', 'warn', 'error']) – How to handle serialization errors. False/”none” ignores them, True/”warn” logs errors, β€œerror” raises a [PydanticSerializationError][pydantic_core.PydanticSerializationError].

  • fallback (Callable[[Any], Any] | None) – A function to call when an unknown value is encountered. If not provided, a [PydanticSerializationError][pydantic_core.PydanticSerializationError] error is raised.

  • serialize_as_any (bool) – Whether to serialize fields with duck-typing serialization behavior.

  • polymorphic_serialization (bool | None) – Whether to use model and dataclass polymorphic serialization for this call.

Returns:

A dictionary representation of the model.

Return type:

dict[str, Any]

model_dump_json(*, indent=None, ensure_ascii=False, include=None, exclude=None, context=None, by_alias=None, exclude_unset=False, exclude_defaults=False, exclude_none=False, exclude_computed_fields=False, round_trip=False, warnings=True, fallback=None, serialize_as_any=False, polymorphic_serialization=None)ΒΆ
!!! abstract β€œUsage Documentation”

[model_dump_json](../concepts/serialization.md#json-mode)

Generates a JSON representation of the model using Pydantic’s to_json method.

Parameters:
  • indent (int | None) – Indentation to use in the JSON output. If None is passed, the output will be compact.

  • ensure_ascii (bool) – If True, the output is guaranteed to have all incoming non-ASCII characters escaped. If False (the default), these characters will be output as-is.

  • include (set[int] | set[str] | Mapping[int, set[int] | set[str] | Mapping[int, IncEx | bool] | Mapping[str, IncEx | bool] | bool] | Mapping[str, set[int] | set[str] | Mapping[int, IncEx | bool] | Mapping[str, IncEx | bool] | bool] | None) – Field(s) to include in the JSON output.

  • exclude (set[int] | set[str] | Mapping[int, set[int] | set[str] | Mapping[int, IncEx | bool] | Mapping[str, IncEx | bool] | bool] | Mapping[str, set[int] | set[str] | Mapping[int, IncEx | bool] | Mapping[str, IncEx | bool] | bool] | None) – Field(s) to exclude from the JSON output.

  • context (Any | None) – Additional context to pass to the serializer.

  • by_alias (bool | None) – Whether to serialize using field aliases.

  • exclude_unset (bool) – Whether to exclude fields that have not been explicitly set.

  • exclude_defaults (bool) – Whether to exclude fields that are set to their default value.

  • exclude_none (bool) – Whether to exclude fields that have a value of None.

  • exclude_computed_fields (bool) – Whether to exclude computed fields. While this can be useful for round-tripping, it is usually recommended to use the dedicated round_trip parameter instead.

  • round_trip (bool) – If True, dumped values should be valid as input for non-idempotent types such as Json[T].

  • warnings (bool | Literal['none', 'warn', 'error']) – How to handle serialization errors. False/”none” ignores them, True/”warn” logs errors, β€œerror” raises a [PydanticSerializationError][pydantic_core.PydanticSerializationError].

  • fallback (Callable[[Any], Any] | None) – A function to call when an unknown value is encountered. If not provided, a [PydanticSerializationError][pydantic_core.PydanticSerializationError] error is raised.

  • serialize_as_any (bool) – Whether to serialize fields with duck-typing serialization behavior.

  • polymorphic_serialization (bool | None) – Whether to use model and dataclass polymorphic serialization for this call.

Returns:

A JSON string representation of the model.

Return type:

str

property model_extra: dict[str, Any] | NoneΒΆ

Get extra fields set during validation.

Returns:

A dictionary of extra fields, or None if config.extra is not set to β€œallow”.

model_fields = {'eventDate': FieldInfo(annotation=str, required=False, default='', description='Date of the event.'), 'eventLocation': FieldInfo(annotation=str, required=False, default='', description='Location or venue of the event.'), 'eventTime': FieldInfo(annotation=str, required=False, default='', description='Scheduled time of the event.'), 'eventTitle': FieldInfo(annotation=str, required=False, default='', description='Title or summary of the event.'), 'id': FieldInfo(annotation=Union[str, int, NoneType], required=False, default=None, description='Event identifier.'), 'type': FieldInfo(annotation=str, required=False, default='', description="Type of event ('event', 'game', 'practice').")}ΒΆ
property model_fields_set: set[str]ΒΆ

Returns the set of fields that have been explicitly set on this model instance.

Returns:

A set of strings representing the fields that have been set,

i.e. that were not filled from defaults.

classmethod model_json_schema(by_alias=True, ref_template='#/$defs/{model}', schema_generator=<class 'pydantic.json_schema.GenerateJsonSchema'>, mode='validation', *, union_format='any_of')ΒΆ

Generates a JSON schema for a model class.

Parameters:
  • by_alias (bool) – Whether to use attribute aliases or not.

  • ref_template (str) – The reference template.

  • union_format (Literal['any_of', 'primitive_type_array']) –

    The format to use when combining schemas from unions together. Can be one of:

    keyword to combine schemas (the default). - β€˜primitive_type_array’: Use the [type](https://json-schema.org/understanding-json-schema/reference/type) keyword as an array of strings, containing each type of the combination. If any of the schemas is not a primitive type (string, boolean, null, integer or number) or contains constraints/metadata, falls back to any_of.

  • schema_generator (type[GenerateJsonSchema]) – To override the logic used to generate the JSON schema, as a subclass of GenerateJsonSchema with your desired modifications

  • mode (Literal['validation', 'serialization']) – The mode in which to generate the schema.

Returns:

The JSON schema for the given model class.

Return type:

dict[str, Any]

classmethod model_parametrized_name(params)ΒΆ

Compute the class name for parametrizations of generic classes.

This method can be overridden to achieve a custom naming scheme for generic BaseModels.

Parameters:

params (tuple[type[Any], ...]) – Tuple of types of the class. Given a generic class Model with 2 type variables and a concrete model Model[str, int], the value (str, int) would be passed to params.

Returns:

String representing the new class where params are passed to cls as type variables.

Raises:

TypeError – Raised when trying to generate concrete names for non-generic models.

Return type:

str

model_post_init(context, /)ΒΆ

Override this method to perform additional initialization after __init__ and model_construct. This is useful if you want to do some validation that requires the entire model to be initialized.

classmethod model_rebuild(*, force=False, raise_errors=True, _parent_namespace_depth=2, _types_namespace=None)ΒΆ

Try to rebuild the pydantic-core schema for the model.

This may be necessary when one of the annotations is a ForwardRef which could not be resolved during the initial attempt to build the schema, and automatic rebuilding fails.

Parameters:
  • force (bool) – Whether to force the rebuilding of the model schema, defaults to False.

  • raise_errors (bool) – Whether to raise errors, defaults to True.

  • _parent_namespace_depth (int) – The depth level of the parent namespace, defaults to 2.

  • _types_namespace (MappingNamespace | None) – The types namespace, defaults to None.

Returns:

Returns None if the schema is already β€œcomplete” and rebuilding was not required. If rebuilding _was_ required, returns True if rebuilding was successful, otherwise False.

Return type:

bool | None

classmethod model_validate(obj, *, strict=None, extra=None, from_attributes=None, context=None, by_alias=None, by_name=None)ΒΆ

Validate a pydantic model instance.

Parameters:
  • obj (Any) – The object to validate.

  • strict (bool | None) – Whether to enforce types strictly.

  • extra (Literal['allow', 'ignore', 'forbid'] | None) – Whether to ignore, allow, or forbid extra data during model validation. See the [extra configuration value][pydantic.ConfigDict.extra] for details.

  • from_attributes (bool | None) – Whether to extract data from object attributes.

  • context (Any | None) – Additional context to pass to the validator.

  • by_alias (bool | None) – Whether to use the field’s alias when validating against the provided input data.

  • by_name (bool | None) – Whether to use the field’s name when validating against the provided input data.

Raises:

ValidationError – If the object could not be validated.

Returns:

The validated model instance.

Return type:

Self

classmethod model_validate_json(json_data, *, strict=None, extra=None, context=None, by_alias=None, by_name=None)ΒΆ
!!! abstract β€œUsage Documentation”

[JSON Parsing](../concepts/json.md#json-parsing)

Validate the given JSON data against the Pydantic model.

Parameters:
  • json_data (str | bytes | bytearray) – The JSON data to validate.

  • strict (bool | None) – Whether to enforce types strictly.

  • extra (Literal['allow', 'ignore', 'forbid'] | None) – Whether to ignore, allow, or forbid extra data during model validation. See the [extra configuration value][pydantic.ConfigDict.extra] for details.

  • context (Any | None) – Extra variables to pass to the validator.

  • by_alias (bool | None) – Whether to use the field’s alias when validating against the provided input data.

  • by_name (bool | None) – Whether to use the field’s name when validating against the provided input data.

Returns:

The validated Pydantic model.

Raises:

ValidationError – If json_data is not a JSON string or the object could not be validated.

Return type:

Self

classmethod model_validate_strings(obj, *, strict=None, extra=None, context=None, by_alias=None, by_name=None)ΒΆ

Validate the given object with string data against the Pydantic model.

Parameters:
  • obj (Any) – The object containing string data to validate.

  • strict (bool | None) – Whether to enforce types strictly.

  • extra (Literal['allow', 'ignore', 'forbid'] | None) – Whether to ignore, allow, or forbid extra data during model validation. See the [extra configuration value][pydantic.ConfigDict.extra] for details.

  • context (Any | None) – Extra variables to pass to the validator.

  • by_alias (bool | None) – Whether to use the field’s alias when validating against the provided input data.

  • by_name (bool | None) – Whether to use the field’s name when validating against the provided input data.

Returns:

The validated Pydantic model.

Return type:

Self

classmethod parse_file(path, *, content_type=None, encoding='utf8', proto=None, allow_pickle=False)ΒΆ
Return type:

Self

classmethod parse_obj(obj)ΒΆ
Return type:

Self

classmethod parse_raw(b, *, content_type=None, encoding='utf8', proto=None, allow_pickle=False)ΒΆ
Return type:

Self

classmethod schema(by_alias=True, ref_template='#/$defs/{model}')ΒΆ
Return type:

Dict[str, Any]

classmethod schema_json(*, by_alias=True, ref_template='#/$defs/{model}', **dumps_kwargs)ΒΆ
Return type:

str

classmethod update_forward_refs(**localns)ΒΆ
classmethod validate(value)ΒΆ
Return type:

Self

class gamesheet_sdk.teams.ScheduleEventDetail[source]ΒΆ

Bases: BaseModel

Detailed metadata for a calendar event occurrence.

idΒΆ

Event identifier.

Type:

str | int | None

typeΒΆ

Type of event (β€˜event’, β€˜game’, β€˜practice’).

Type:

str

eventDateΒΆ

Date of the event.

Type:

str

eventLocationΒΆ

Location or venue of the event.

Type:

str

eventTimeΒΆ

Scheduled time of the event.

Type:

str

eventTitleΒΆ

Title or summary description of the event.

Type:

str

eventDataΒΆ

Detailed event payload.

Type:

dict[str, Any] | None

availabilityΒΆ

Optional availability data when requested.

Type:

Any

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

model_config = {'extra': 'allow'}ΒΆ

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

id: str | int | NoneΒΆ
type: strΒΆ
eventDate: strΒΆ
eventLocation: strΒΆ
eventTime: strΒΆ
eventTitle: strΒΆ
eventData: dict[str, Any] | NoneΒΆ
availability: AnyΒΆ
__init__(**data)ΒΆ

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

classmethod construct(_fields_set=None, **values)ΒΆ
Return type:

Self

copy(*, include=None, exclude=None, update=None, deep=False)ΒΆ

Returns a copy of the model.

!!! warning β€œDeprecated”

This method is now deprecated; use model_copy instead.

If you need include or exclude, use:

`python {test="skip" lint="skip"} data = self.model_dump(include=include, exclude=exclude, round_trip=True) data = {**data, **(update or {})} copied = self.model_validate(data) `

Parameters:
  • include (AbstractSetIntStr | MappingIntStrAny | None) – Optional set or mapping specifying which fields to include in the copied model.

  • exclude (AbstractSetIntStr | MappingIntStrAny | None) – Optional set or mapping specifying which fields to exclude in the copied model.

  • update (Dict[str, Any] | None) – Optional dictionary of field-value pairs to override field values in the copied model.

  • deep (bool) – If True, the values of fields that are Pydantic models will be deep-copied.

Returns:

A copy of the model with included, excluded and updated fields as specified.

Return type:

Self

dict(*, include=None, exclude=None, by_alias=False, exclude_unset=False, exclude_defaults=False, exclude_none=False)ΒΆ
Return type:

Dict[str, Any]

classmethod from_orm(obj)ΒΆ
Return type:

Self

json(*, include=None, exclude=None, by_alias=False, exclude_unset=False, exclude_defaults=False, exclude_none=False, encoder=PydanticUndefined, models_as_dict=PydanticUndefined, **dumps_kwargs)ΒΆ
Return type:

str

model_computed_fields = {}ΒΆ
classmethod model_construct(_fields_set=None, **values)ΒΆ

Creates a new instance of the Model class with validated data.

Creates a new model setting __dict__ and __pydantic_fields_set__ from trusted or pre-validated data. Default values are respected, but no other validation is performed.

!!! note

model_construct() generally respects the model_config.extra setting on the provided model. That is, if model_config.extra == β€˜allow’, then all extra passed values are added to the model instance’s __dict__ and __pydantic_extra__ fields. If model_config.extra == β€˜ignore’ (the default), then all extra passed values are ignored. Because no validation is performed with a call to model_construct(), having model_config.extra == β€˜forbid’ does not result in an error if extra values are passed, but they will be ignored.

Parameters:
  • _fields_set (set[str] | None) – A set of field names that were originally explicitly set during instantiation. If provided, this is directly used for the [model_fields_set][pydantic.BaseModel.model_fields_set] attribute. Otherwise, the field names from the values argument will be used.

  • values (Any) – Trusted or pre-validated data dictionary.

Returns:

A new instance of the Model class with validated data.

Return type:

Self

model_copy(*, update=None, deep=False)ΒΆ
!!! abstract β€œUsage Documentation”

[model_copy](../concepts/models.md#model-copy)

Returns a copy of the model.

!!! note

The underlying instance’s [__dict__][object.__dict__] attribute is copied. This might have unexpected side effects if you store anything in it, on top of the model fields (e.g. the value of [cached properties][functools.cached_property]).

Parameters:
  • update (Mapping[str, Any] | None) – Values to change/add in the new model. Note: the data is not validated before creating the new model. You should trust this data.

  • deep (bool) – Set to True to make a deep copy of the model.

Returns:

New model instance.

Return type:

Self

model_dump(*, mode='python', include=None, exclude=None, context=None, by_alias=None, exclude_unset=False, exclude_defaults=False, exclude_none=False, exclude_computed_fields=False, round_trip=False, warnings=True, fallback=None, serialize_as_any=False, polymorphic_serialization=None)ΒΆ
!!! abstract β€œUsage Documentation”

[model_dump](../concepts/serialization.md#python-mode)

Generate a dictionary representation of the model, optionally specifying which fields to include or exclude.

Parameters:
  • mode (Literal['json', 'python'] | str) – The mode in which to_python should run. If mode is β€˜json’, the output will only contain JSON serializable types. If mode is β€˜python’, the output may contain non-JSON-serializable Python objects.

  • include (set[int] | set[str] | Mapping[int, set[int] | set[str] | Mapping[int, IncEx | bool] | Mapping[str, IncEx | bool] | bool] | Mapping[str, set[int] | set[str] | Mapping[int, IncEx | bool] | Mapping[str, IncEx | bool] | bool] | None) – A set of fields to include in the output.

  • exclude (set[int] | set[str] | Mapping[int, set[int] | set[str] | Mapping[int, IncEx | bool] | Mapping[str, IncEx | bool] | bool] | Mapping[str, set[int] | set[str] | Mapping[int, IncEx | bool] | Mapping[str, IncEx | bool] | bool] | None) – A set of fields to exclude from the output.

  • context (Any | None) – Additional context to pass to the serializer.

  • by_alias (bool | None) – Whether to use the field’s alias in the dictionary key if defined.

  • exclude_unset (bool) – Whether to exclude fields that have not been explicitly set.

  • exclude_defaults (bool) – Whether to exclude fields that are set to their default value.

  • exclude_none (bool) – Whether to exclude fields that have a value of None.

  • exclude_computed_fields (bool) – Whether to exclude computed fields. While this can be useful for round-tripping, it is usually recommended to use the dedicated round_trip parameter instead.

  • round_trip (bool) – If True, dumped values should be valid as input for non-idempotent types such as Json[T].

  • warnings (bool | Literal['none', 'warn', 'error']) – How to handle serialization errors. False/”none” ignores them, True/”warn” logs errors, β€œerror” raises a [PydanticSerializationError][pydantic_core.PydanticSerializationError].

  • fallback (Callable[[Any], Any] | None) – A function to call when an unknown value is encountered. If not provided, a [PydanticSerializationError][pydantic_core.PydanticSerializationError] error is raised.

  • serialize_as_any (bool) – Whether to serialize fields with duck-typing serialization behavior.

  • polymorphic_serialization (bool | None) – Whether to use model and dataclass polymorphic serialization for this call.

Returns:

A dictionary representation of the model.

Return type:

dict[str, Any]

model_dump_json(*, indent=None, ensure_ascii=False, include=None, exclude=None, context=None, by_alias=None, exclude_unset=False, exclude_defaults=False, exclude_none=False, exclude_computed_fields=False, round_trip=False, warnings=True, fallback=None, serialize_as_any=False, polymorphic_serialization=None)ΒΆ
!!! abstract β€œUsage Documentation”

[model_dump_json](../concepts/serialization.md#json-mode)

Generates a JSON representation of the model using Pydantic’s to_json method.

Parameters:
  • indent (int | None) – Indentation to use in the JSON output. If None is passed, the output will be compact.

  • ensure_ascii (bool) – If True, the output is guaranteed to have all incoming non-ASCII characters escaped. If False (the default), these characters will be output as-is.

  • include (set[int] | set[str] | Mapping[int, set[int] | set[str] | Mapping[int, IncEx | bool] | Mapping[str, IncEx | bool] | bool] | Mapping[str, set[int] | set[str] | Mapping[int, IncEx | bool] | Mapping[str, IncEx | bool] | bool] | None) – Field(s) to include in the JSON output.

  • exclude (set[int] | set[str] | Mapping[int, set[int] | set[str] | Mapping[int, IncEx | bool] | Mapping[str, IncEx | bool] | bool] | Mapping[str, set[int] | set[str] | Mapping[int, IncEx | bool] | Mapping[str, IncEx | bool] | bool] | None) – Field(s) to exclude from the JSON output.

  • context (Any | None) – Additional context to pass to the serializer.

  • by_alias (bool | None) – Whether to serialize using field aliases.

  • exclude_unset (bool) – Whether to exclude fields that have not been explicitly set.

  • exclude_defaults (bool) – Whether to exclude fields that are set to their default value.

  • exclude_none (bool) – Whether to exclude fields that have a value of None.

  • exclude_computed_fields (bool) – Whether to exclude computed fields. While this can be useful for round-tripping, it is usually recommended to use the dedicated round_trip parameter instead.

  • round_trip (bool) – If True, dumped values should be valid as input for non-idempotent types such as Json[T].

  • warnings (bool | Literal['none', 'warn', 'error']) – How to handle serialization errors. False/”none” ignores them, True/”warn” logs errors, β€œerror” raises a [PydanticSerializationError][pydantic_core.PydanticSerializationError].

  • fallback (Callable[[Any], Any] | None) – A function to call when an unknown value is encountered. If not provided, a [PydanticSerializationError][pydantic_core.PydanticSerializationError] error is raised.

  • serialize_as_any (bool) – Whether to serialize fields with duck-typing serialization behavior.

  • polymorphic_serialization (bool | None) – Whether to use model and dataclass polymorphic serialization for this call.

Returns:

A JSON string representation of the model.

Return type:

str

property model_extra: dict[str, Any] | NoneΒΆ

Get extra fields set during validation.

Returns:

A dictionary of extra fields, or None if config.extra is not set to β€œallow”.

model_fields = {'availability': FieldInfo(annotation=Any, required=False, default=None, description='Optional availability data.'), 'eventData': FieldInfo(annotation=Union[dict[str, Any], NoneType], required=False, default=None, description='Detailed event payload.'), 'eventDate': FieldInfo(annotation=str, required=False, default='', description='Date of the event.'), 'eventLocation': FieldInfo(annotation=str, required=False, default='', description='Location or venue of the event.'), 'eventTime': FieldInfo(annotation=str, required=False, default='', description='Scheduled time of the event.'), 'eventTitle': FieldInfo(annotation=str, required=False, default='', description='Title or summary of the event.'), 'id': FieldInfo(annotation=Union[str, int, NoneType], required=False, default=None, description='Event identifier.'), 'type': FieldInfo(annotation=str, required=False, default='', description="Type of event ('event', 'game', 'practice').")}ΒΆ
property model_fields_set: set[str]ΒΆ

Returns the set of fields that have been explicitly set on this model instance.

Returns:

A set of strings representing the fields that have been set,

i.e. that were not filled from defaults.

classmethod model_json_schema(by_alias=True, ref_template='#/$defs/{model}', schema_generator=<class 'pydantic.json_schema.GenerateJsonSchema'>, mode='validation', *, union_format='any_of')ΒΆ

Generates a JSON schema for a model class.

Parameters:
  • by_alias (bool) – Whether to use attribute aliases or not.

  • ref_template (str) – The reference template.

  • union_format (Literal['any_of', 'primitive_type_array']) –

    The format to use when combining schemas from unions together. Can be one of:

    keyword to combine schemas (the default). - β€˜primitive_type_array’: Use the [type](https://json-schema.org/understanding-json-schema/reference/type) keyword as an array of strings, containing each type of the combination. If any of the schemas is not a primitive type (string, boolean, null, integer or number) or contains constraints/metadata, falls back to any_of.

  • schema_generator (type[GenerateJsonSchema]) – To override the logic used to generate the JSON schema, as a subclass of GenerateJsonSchema with your desired modifications

  • mode (Literal['validation', 'serialization']) – The mode in which to generate the schema.

Returns:

The JSON schema for the given model class.

Return type:

dict[str, Any]

classmethod model_parametrized_name(params)ΒΆ

Compute the class name for parametrizations of generic classes.

This method can be overridden to achieve a custom naming scheme for generic BaseModels.

Parameters:

params (tuple[type[Any], ...]) – Tuple of types of the class. Given a generic class Model with 2 type variables and a concrete model Model[str, int], the value (str, int) would be passed to params.

Returns:

String representing the new class where params are passed to cls as type variables.

Raises:

TypeError – Raised when trying to generate concrete names for non-generic models.

Return type:

str

model_post_init(context, /)ΒΆ

Override this method to perform additional initialization after __init__ and model_construct. This is useful if you want to do some validation that requires the entire model to be initialized.

classmethod model_rebuild(*, force=False, raise_errors=True, _parent_namespace_depth=2, _types_namespace=None)ΒΆ

Try to rebuild the pydantic-core schema for the model.

This may be necessary when one of the annotations is a ForwardRef which could not be resolved during the initial attempt to build the schema, and automatic rebuilding fails.

Parameters:
  • force (bool) – Whether to force the rebuilding of the model schema, defaults to False.

  • raise_errors (bool) – Whether to raise errors, defaults to True.

  • _parent_namespace_depth (int) – The depth level of the parent namespace, defaults to 2.

  • _types_namespace (MappingNamespace | None) – The types namespace, defaults to None.

Returns:

Returns None if the schema is already β€œcomplete” and rebuilding was not required. If rebuilding _was_ required, returns True if rebuilding was successful, otherwise False.

Return type:

bool | None

classmethod model_validate(obj, *, strict=None, extra=None, from_attributes=None, context=None, by_alias=None, by_name=None)ΒΆ

Validate a pydantic model instance.

Parameters:
  • obj (Any) – The object to validate.

  • strict (bool | None) – Whether to enforce types strictly.

  • extra (Literal['allow', 'ignore', 'forbid'] | None) – Whether to ignore, allow, or forbid extra data during model validation. See the [extra configuration value][pydantic.ConfigDict.extra] for details.

  • from_attributes (bool | None) – Whether to extract data from object attributes.

  • context (Any | None) – Additional context to pass to the validator.

  • by_alias (bool | None) – Whether to use the field’s alias when validating against the provided input data.

  • by_name (bool | None) – Whether to use the field’s name when validating against the provided input data.

Raises:

ValidationError – If the object could not be validated.

Returns:

The validated model instance.

Return type:

Self

classmethod model_validate_json(json_data, *, strict=None, extra=None, context=None, by_alias=None, by_name=None)ΒΆ
!!! abstract β€œUsage Documentation”

[JSON Parsing](../concepts/json.md#json-parsing)

Validate the given JSON data against the Pydantic model.

Parameters:
  • json_data (str | bytes | bytearray) – The JSON data to validate.

  • strict (bool | None) – Whether to enforce types strictly.

  • extra (Literal['allow', 'ignore', 'forbid'] | None) – Whether to ignore, allow, or forbid extra data during model validation. See the [extra configuration value][pydantic.ConfigDict.extra] for details.

  • context (Any | None) – Extra variables to pass to the validator.

  • by_alias (bool | None) – Whether to use the field’s alias when validating against the provided input data.

  • by_name (bool | None) – Whether to use the field’s name when validating against the provided input data.

Returns:

The validated Pydantic model.

Raises:

ValidationError – If json_data is not a JSON string or the object could not be validated.

Return type:

Self

classmethod model_validate_strings(obj, *, strict=None, extra=None, context=None, by_alias=None, by_name=None)ΒΆ

Validate the given object with string data against the Pydantic model.

Parameters:
  • obj (Any) – The object containing string data to validate.

  • strict (bool | None) – Whether to enforce types strictly.

  • extra (Literal['allow', 'ignore', 'forbid'] | None) – Whether to ignore, allow, or forbid extra data during model validation. See the [extra configuration value][pydantic.ConfigDict.extra] for details.

  • context (Any | None) – Extra variables to pass to the validator.

  • by_alias (bool | None) – Whether to use the field’s alias when validating against the provided input data.

  • by_name (bool | None) – Whether to use the field’s name when validating against the provided input data.

Returns:

The validated Pydantic model.

Return type:

Self

classmethod parse_file(path, *, content_type=None, encoding='utf8', proto=None, allow_pickle=False)ΒΆ
Return type:

Self

classmethod parse_obj(obj)ΒΆ
Return type:

Self

classmethod parse_raw(b, *, content_type=None, encoding='utf8', proto=None, allow_pickle=False)ΒΆ
Return type:

Self

classmethod schema(by_alias=True, ref_template='#/$defs/{model}')ΒΆ
Return type:

Dict[str, Any]

classmethod schema_json(*, by_alias=True, ref_template='#/$defs/{model}', **dumps_kwargs)ΒΆ
Return type:

str

classmethod update_forward_refs(**localns)ΒΆ
classmethod validate(value)ΒΆ
Return type:

Self

class gamesheet_sdk.teams.SeasonDetail[source]ΒΆ

Bases: BaseModel

Detailed season metadata with penaltyCodes and teams excluded.

idΒΆ

Season identifier.

Type:

str | int | None

titleΒΆ

Display name of the season.

Type:

str | None

stats_yearΒΆ

Statistics year label.

Type:

str | int | None

leagueIdΒΆ

Parent league identifier.

Type:

str | int | None

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

model_config = {'extra': 'allow'}ΒΆ

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

id: str | int | NoneΒΆ
title: str | NoneΒΆ
stats_year: str | int | NoneΒΆ
leagueId: str | int | NoneΒΆ
__init__(**data)ΒΆ

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

classmethod construct(_fields_set=None, **values)ΒΆ
Return type:

Self

copy(*, include=None, exclude=None, update=None, deep=False)ΒΆ

Returns a copy of the model.

!!! warning β€œDeprecated”

This method is now deprecated; use model_copy instead.

If you need include or exclude, use:

`python {test="skip" lint="skip"} data = self.model_dump(include=include, exclude=exclude, round_trip=True) data = {**data, **(update or {})} copied = self.model_validate(data) `

Parameters:
  • include (AbstractSetIntStr | MappingIntStrAny | None) – Optional set or mapping specifying which fields to include in the copied model.

  • exclude (AbstractSetIntStr | MappingIntStrAny | None) – Optional set or mapping specifying which fields to exclude in the copied model.

  • update (Dict[str, Any] | None) – Optional dictionary of field-value pairs to override field values in the copied model.

  • deep (bool) – If True, the values of fields that are Pydantic models will be deep-copied.

Returns:

A copy of the model with included, excluded and updated fields as specified.

Return type:

Self

dict(*, include=None, exclude=None, by_alias=False, exclude_unset=False, exclude_defaults=False, exclude_none=False)ΒΆ
Return type:

Dict[str, Any]

classmethod from_orm(obj)ΒΆ
Return type:

Self

json(*, include=None, exclude=None, by_alias=False, exclude_unset=False, exclude_defaults=False, exclude_none=False, encoder=PydanticUndefined, models_as_dict=PydanticUndefined, **dumps_kwargs)ΒΆ
Return type:

str

model_computed_fields = {}ΒΆ
classmethod model_construct(_fields_set=None, **values)ΒΆ

Creates a new instance of the Model class with validated data.

Creates a new model setting __dict__ and __pydantic_fields_set__ from trusted or pre-validated data. Default values are respected, but no other validation is performed.

!!! note

model_construct() generally respects the model_config.extra setting on the provided model. That is, if model_config.extra == β€˜allow’, then all extra passed values are added to the model instance’s __dict__ and __pydantic_extra__ fields. If model_config.extra == β€˜ignore’ (the default), then all extra passed values are ignored. Because no validation is performed with a call to model_construct(), having model_config.extra == β€˜forbid’ does not result in an error if extra values are passed, but they will be ignored.

Parameters:
  • _fields_set (set[str] | None) – A set of field names that were originally explicitly set during instantiation. If provided, this is directly used for the [model_fields_set][pydantic.BaseModel.model_fields_set] attribute. Otherwise, the field names from the values argument will be used.

  • values (Any) – Trusted or pre-validated data dictionary.

Returns:

A new instance of the Model class with validated data.

Return type:

Self

model_copy(*, update=None, deep=False)ΒΆ
!!! abstract β€œUsage Documentation”

[model_copy](../concepts/models.md#model-copy)

Returns a copy of the model.

!!! note

The underlying instance’s [__dict__][object.__dict__] attribute is copied. This might have unexpected side effects if you store anything in it, on top of the model fields (e.g. the value of [cached properties][functools.cached_property]).

Parameters:
  • update (Mapping[str, Any] | None) – Values to change/add in the new model. Note: the data is not validated before creating the new model. You should trust this data.

  • deep (bool) – Set to True to make a deep copy of the model.

Returns:

New model instance.

Return type:

Self

model_dump(*, mode='python', include=None, exclude=None, context=None, by_alias=None, exclude_unset=False, exclude_defaults=False, exclude_none=False, exclude_computed_fields=False, round_trip=False, warnings=True, fallback=None, serialize_as_any=False, polymorphic_serialization=None)ΒΆ
!!! abstract β€œUsage Documentation”

[model_dump](../concepts/serialization.md#python-mode)

Generate a dictionary representation of the model, optionally specifying which fields to include or exclude.

Parameters:
  • mode (Literal['json', 'python'] | str) – The mode in which to_python should run. If mode is β€˜json’, the output will only contain JSON serializable types. If mode is β€˜python’, the output may contain non-JSON-serializable Python objects.

  • include (set[int] | set[str] | Mapping[int, set[int] | set[str] | Mapping[int, IncEx | bool] | Mapping[str, IncEx | bool] | bool] | Mapping[str, set[int] | set[str] | Mapping[int, IncEx | bool] | Mapping[str, IncEx | bool] | bool] | None) – A set of fields to include in the output.

  • exclude (set[int] | set[str] | Mapping[int, set[int] | set[str] | Mapping[int, IncEx | bool] | Mapping[str, IncEx | bool] | bool] | Mapping[str, set[int] | set[str] | Mapping[int, IncEx | bool] | Mapping[str, IncEx | bool] | bool] | None) – A set of fields to exclude from the output.

  • context (Any | None) – Additional context to pass to the serializer.

  • by_alias (bool | None) – Whether to use the field’s alias in the dictionary key if defined.

  • exclude_unset (bool) – Whether to exclude fields that have not been explicitly set.

  • exclude_defaults (bool) – Whether to exclude fields that are set to their default value.

  • exclude_none (bool) – Whether to exclude fields that have a value of None.

  • exclude_computed_fields (bool) – Whether to exclude computed fields. While this can be useful for round-tripping, it is usually recommended to use the dedicated round_trip parameter instead.

  • round_trip (bool) – If True, dumped values should be valid as input for non-idempotent types such as Json[T].

  • warnings (bool | Literal['none', 'warn', 'error']) – How to handle serialization errors. False/”none” ignores them, True/”warn” logs errors, β€œerror” raises a [PydanticSerializationError][pydantic_core.PydanticSerializationError].

  • fallback (Callable[[Any], Any] | None) – A function to call when an unknown value is encountered. If not provided, a [PydanticSerializationError][pydantic_core.PydanticSerializationError] error is raised.

  • serialize_as_any (bool) – Whether to serialize fields with duck-typing serialization behavior.

  • polymorphic_serialization (bool | None) – Whether to use model and dataclass polymorphic serialization for this call.

Returns:

A dictionary representation of the model.

Return type:

dict[str, Any]

model_dump_json(*, indent=None, ensure_ascii=False, include=None, exclude=None, context=None, by_alias=None, exclude_unset=False, exclude_defaults=False, exclude_none=False, exclude_computed_fields=False, round_trip=False, warnings=True, fallback=None, serialize_as_any=False, polymorphic_serialization=None)ΒΆ
!!! abstract β€œUsage Documentation”

[model_dump_json](../concepts/serialization.md#json-mode)

Generates a JSON representation of the model using Pydantic’s to_json method.

Parameters:
  • indent (int | None) – Indentation to use in the JSON output. If None is passed, the output will be compact.

  • ensure_ascii (bool) – If True, the output is guaranteed to have all incoming non-ASCII characters escaped. If False (the default), these characters will be output as-is.

  • include (set[int] | set[str] | Mapping[int, set[int] | set[str] | Mapping[int, IncEx | bool] | Mapping[str, IncEx | bool] | bool] | Mapping[str, set[int] | set[str] | Mapping[int, IncEx | bool] | Mapping[str, IncEx | bool] | bool] | None) – Field(s) to include in the JSON output.

  • exclude (set[int] | set[str] | Mapping[int, set[int] | set[str] | Mapping[int, IncEx | bool] | Mapping[str, IncEx | bool] | bool] | Mapping[str, set[int] | set[str] | Mapping[int, IncEx | bool] | Mapping[str, IncEx | bool] | bool] | None) – Field(s) to exclude from the JSON output.

  • context (Any | None) – Additional context to pass to the serializer.

  • by_alias (bool | None) – Whether to serialize using field aliases.

  • exclude_unset (bool) – Whether to exclude fields that have not been explicitly set.

  • exclude_defaults (bool) – Whether to exclude fields that are set to their default value.

  • exclude_none (bool) – Whether to exclude fields that have a value of None.

  • exclude_computed_fields (bool) – Whether to exclude computed fields. While this can be useful for round-tripping, it is usually recommended to use the dedicated round_trip parameter instead.

  • round_trip (bool) – If True, dumped values should be valid as input for non-idempotent types such as Json[T].

  • warnings (bool | Literal['none', 'warn', 'error']) – How to handle serialization errors. False/”none” ignores them, True/”warn” logs errors, β€œerror” raises a [PydanticSerializationError][pydantic_core.PydanticSerializationError].

  • fallback (Callable[[Any], Any] | None) – A function to call when an unknown value is encountered. If not provided, a [PydanticSerializationError][pydantic_core.PydanticSerializationError] error is raised.

  • serialize_as_any (bool) – Whether to serialize fields with duck-typing serialization behavior.

  • polymorphic_serialization (bool | None) – Whether to use model and dataclass polymorphic serialization for this call.

Returns:

A JSON string representation of the model.

Return type:

str

property model_extra: dict[str, Any] | NoneΒΆ

Get extra fields set during validation.

Returns:

A dictionary of extra fields, or None if config.extra is not set to β€œallow”.

model_fields = {'id': FieldInfo(annotation=Union[str, int, NoneType], required=False, default=None, description='Season identifier.'), 'leagueId': FieldInfo(annotation=Union[str, int, NoneType], required=False, default=None, description='Parent league identifier.'), 'stats_year': FieldInfo(annotation=Union[str, int, NoneType], required=False, default=None, description='Statistics year label.'), 'title': FieldInfo(annotation=Union[str, NoneType], required=False, default=None, description='Display name of the season.')}ΒΆ
property model_fields_set: set[str]ΒΆ

Returns the set of fields that have been explicitly set on this model instance.

Returns:

A set of strings representing the fields that have been set,

i.e. that were not filled from defaults.

classmethod model_json_schema(by_alias=True, ref_template='#/$defs/{model}', schema_generator=<class 'pydantic.json_schema.GenerateJsonSchema'>, mode='validation', *, union_format='any_of')ΒΆ

Generates a JSON schema for a model class.

Parameters:
  • by_alias (bool) – Whether to use attribute aliases or not.

  • ref_template (str) – The reference template.

  • union_format (Literal['any_of', 'primitive_type_array']) –

    The format to use when combining schemas from unions together. Can be one of:

    keyword to combine schemas (the default). - β€˜primitive_type_array’: Use the [type](https://json-schema.org/understanding-json-schema/reference/type) keyword as an array of strings, containing each type of the combination. If any of the schemas is not a primitive type (string, boolean, null, integer or number) or contains constraints/metadata, falls back to any_of.

  • schema_generator (type[GenerateJsonSchema]) – To override the logic used to generate the JSON schema, as a subclass of GenerateJsonSchema with your desired modifications

  • mode (Literal['validation', 'serialization']) – The mode in which to generate the schema.

Returns:

The JSON schema for the given model class.

Return type:

dict[str, Any]

classmethod model_parametrized_name(params)ΒΆ

Compute the class name for parametrizations of generic classes.

This method can be overridden to achieve a custom naming scheme for generic BaseModels.

Parameters:

params (tuple[type[Any], ...]) – Tuple of types of the class. Given a generic class Model with 2 type variables and a concrete model Model[str, int], the value (str, int) would be passed to params.

Returns:

String representing the new class where params are passed to cls as type variables.

Raises:

TypeError – Raised when trying to generate concrete names for non-generic models.

Return type:

str

model_post_init(context, /)ΒΆ

Override this method to perform additional initialization after __init__ and model_construct. This is useful if you want to do some validation that requires the entire model to be initialized.

classmethod model_rebuild(*, force=False, raise_errors=True, _parent_namespace_depth=2, _types_namespace=None)ΒΆ

Try to rebuild the pydantic-core schema for the model.

This may be necessary when one of the annotations is a ForwardRef which could not be resolved during the initial attempt to build the schema, and automatic rebuilding fails.

Parameters:
  • force (bool) – Whether to force the rebuilding of the model schema, defaults to False.

  • raise_errors (bool) – Whether to raise errors, defaults to True.

  • _parent_namespace_depth (int) – The depth level of the parent namespace, defaults to 2.

  • _types_namespace (MappingNamespace | None) – The types namespace, defaults to None.

Returns:

Returns None if the schema is already β€œcomplete” and rebuilding was not required. If rebuilding _was_ required, returns True if rebuilding was successful, otherwise False.

Return type:

bool | None

classmethod model_validate(obj, *, strict=None, extra=None, from_attributes=None, context=None, by_alias=None, by_name=None)ΒΆ

Validate a pydantic model instance.

Parameters:
  • obj (Any) – The object to validate.

  • strict (bool | None) – Whether to enforce types strictly.

  • extra (Literal['allow', 'ignore', 'forbid'] | None) – Whether to ignore, allow, or forbid extra data during model validation. See the [extra configuration value][pydantic.ConfigDict.extra] for details.

  • from_attributes (bool | None) – Whether to extract data from object attributes.

  • context (Any | None) – Additional context to pass to the validator.

  • by_alias (bool | None) – Whether to use the field’s alias when validating against the provided input data.

  • by_name (bool | None) – Whether to use the field’s name when validating against the provided input data.

Raises:

ValidationError – If the object could not be validated.

Returns:

The validated model instance.

Return type:

Self

classmethod model_validate_json(json_data, *, strict=None, extra=None, context=None, by_alias=None, by_name=None)ΒΆ
!!! abstract β€œUsage Documentation”

[JSON Parsing](../concepts/json.md#json-parsing)

Validate the given JSON data against the Pydantic model.

Parameters:
  • json_data (str | bytes | bytearray) – The JSON data to validate.

  • strict (bool | None) – Whether to enforce types strictly.

  • extra (Literal['allow', 'ignore', 'forbid'] | None) – Whether to ignore, allow, or forbid extra data during model validation. See the [extra configuration value][pydantic.ConfigDict.extra] for details.

  • context (Any | None) – Extra variables to pass to the validator.

  • by_alias (bool | None) – Whether to use the field’s alias when validating against the provided input data.

  • by_name (bool | None) – Whether to use the field’s name when validating against the provided input data.

Returns:

The validated Pydantic model.

Raises:

ValidationError – If json_data is not a JSON string or the object could not be validated.

Return type:

Self

classmethod model_validate_strings(obj, *, strict=None, extra=None, context=None, by_alias=None, by_name=None)ΒΆ

Validate the given object with string data against the Pydantic model.

Parameters:
  • obj (Any) – The object containing string data to validate.

  • strict (bool | None) – Whether to enforce types strictly.

  • extra (Literal['allow', 'ignore', 'forbid'] | None) – Whether to ignore, allow, or forbid extra data during model validation. See the [extra configuration value][pydantic.ConfigDict.extra] for details.

  • context (Any | None) – Extra variables to pass to the validator.

  • by_alias (bool | None) – Whether to use the field’s alias when validating against the provided input data.

  • by_name (bool | None) – Whether to use the field’s name when validating against the provided input data.

Returns:

The validated Pydantic model.

Return type:

Self

classmethod parse_file(path, *, content_type=None, encoding='utf8', proto=None, allow_pickle=False)ΒΆ
Return type:

Self

classmethod parse_obj(obj)ΒΆ
Return type:

Self

classmethod parse_raw(b, *, content_type=None, encoding='utf8', proto=None, allow_pickle=False)ΒΆ
Return type:

Self

classmethod schema(by_alias=True, ref_template='#/$defs/{model}')ΒΆ
Return type:

Dict[str, Any]

classmethod schema_json(*, by_alias=True, ref_template='#/$defs/{model}', **dumps_kwargs)ΒΆ
Return type:

str

classmethod update_forward_refs(**localns)ΒΆ
classmethod validate(value)ΒΆ
Return type:

Self

class gamesheet_sdk.teams.SeasonSummary[source]ΒΆ

Bases: BaseModel

Summary of a season for list views.

association_idΒΆ

Parent association identifier.

Type:

str

association_titleΒΆ

Parent association display name.

Type:

str

idΒΆ

Season identifier.

Type:

str

league_idΒΆ

League ID from nested league object.

Type:

str

league_titleΒΆ

League display name.

Type:

str

leagueIdΒΆ

Parent league identifier.

Type:

str

stats_yearΒΆ

Statistics year label.

Type:

str

titleΒΆ

Display name of the season.

Type:

str

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

model_config = {'extra': 'allow'}ΒΆ

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

association_id: strΒΆ
association_title: strΒΆ
id: strΒΆ
league_id: strΒΆ
league_title: strΒΆ
leagueId: strΒΆ
stats_year: strΒΆ
title: strΒΆ
__init__(**data)ΒΆ

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

classmethod construct(_fields_set=None, **values)ΒΆ
Return type:

Self

copy(*, include=None, exclude=None, update=None, deep=False)ΒΆ

Returns a copy of the model.

!!! warning β€œDeprecated”

This method is now deprecated; use model_copy instead.

If you need include or exclude, use:

`python {test="skip" lint="skip"} data = self.model_dump(include=include, exclude=exclude, round_trip=True) data = {**data, **(update or {})} copied = self.model_validate(data) `

Parameters:
  • include (AbstractSetIntStr | MappingIntStrAny | None) – Optional set or mapping specifying which fields to include in the copied model.

  • exclude (AbstractSetIntStr | MappingIntStrAny | None) – Optional set or mapping specifying which fields to exclude in the copied model.

  • update (Dict[str, Any] | None) – Optional dictionary of field-value pairs to override field values in the copied model.

  • deep (bool) – If True, the values of fields that are Pydantic models will be deep-copied.

Returns:

A copy of the model with included, excluded and updated fields as specified.

Return type:

Self

dict(*, include=None, exclude=None, by_alias=False, exclude_unset=False, exclude_defaults=False, exclude_none=False)ΒΆ
Return type:

Dict[str, Any]

classmethod from_orm(obj)ΒΆ
Return type:

Self

json(*, include=None, exclude=None, by_alias=False, exclude_unset=False, exclude_defaults=False, exclude_none=False, encoder=PydanticUndefined, models_as_dict=PydanticUndefined, **dumps_kwargs)ΒΆ
Return type:

str

model_computed_fields = {}ΒΆ
classmethod model_construct(_fields_set=None, **values)ΒΆ

Creates a new instance of the Model class with validated data.

Creates a new model setting __dict__ and __pydantic_fields_set__ from trusted or pre-validated data. Default values are respected, but no other validation is performed.

!!! note

model_construct() generally respects the model_config.extra setting on the provided model. That is, if model_config.extra == β€˜allow’, then all extra passed values are added to the model instance’s __dict__ and __pydantic_extra__ fields. If model_config.extra == β€˜ignore’ (the default), then all extra passed values are ignored. Because no validation is performed with a call to model_construct(), having model_config.extra == β€˜forbid’ does not result in an error if extra values are passed, but they will be ignored.

Parameters:
  • _fields_set (set[str] | None) – A set of field names that were originally explicitly set during instantiation. If provided, this is directly used for the [model_fields_set][pydantic.BaseModel.model_fields_set] attribute. Otherwise, the field names from the values argument will be used.

  • values (Any) – Trusted or pre-validated data dictionary.

Returns:

A new instance of the Model class with validated data.

Return type:

Self

model_copy(*, update=None, deep=False)ΒΆ
!!! abstract β€œUsage Documentation”

[model_copy](../concepts/models.md#model-copy)

Returns a copy of the model.

!!! note

The underlying instance’s [__dict__][object.__dict__] attribute is copied. This might have unexpected side effects if you store anything in it, on top of the model fields (e.g. the value of [cached properties][functools.cached_property]).

Parameters:
  • update (Mapping[str, Any] | None) – Values to change/add in the new model. Note: the data is not validated before creating the new model. You should trust this data.

  • deep (bool) – Set to True to make a deep copy of the model.

Returns:

New model instance.

Return type:

Self

model_dump(*, mode='python', include=None, exclude=None, context=None, by_alias=None, exclude_unset=False, exclude_defaults=False, exclude_none=False, exclude_computed_fields=False, round_trip=False, warnings=True, fallback=None, serialize_as_any=False, polymorphic_serialization=None)ΒΆ
!!! abstract β€œUsage Documentation”

[model_dump](../concepts/serialization.md#python-mode)

Generate a dictionary representation of the model, optionally specifying which fields to include or exclude.

Parameters:
  • mode (Literal['json', 'python'] | str) – The mode in which to_python should run. If mode is β€˜json’, the output will only contain JSON serializable types. If mode is β€˜python’, the output may contain non-JSON-serializable Python objects.

  • include (set[int] | set[str] | Mapping[int, set[int] | set[str] | Mapping[int, IncEx | bool] | Mapping[str, IncEx | bool] | bool] | Mapping[str, set[int] | set[str] | Mapping[int, IncEx | bool] | Mapping[str, IncEx | bool] | bool] | None) – A set of fields to include in the output.

  • exclude (set[int] | set[str] | Mapping[int, set[int] | set[str] | Mapping[int, IncEx | bool] | Mapping[str, IncEx | bool] | bool] | Mapping[str, set[int] | set[str] | Mapping[int, IncEx | bool] | Mapping[str, IncEx | bool] | bool] | None) – A set of fields to exclude from the output.

  • context (Any | None) – Additional context to pass to the serializer.

  • by_alias (bool | None) – Whether to use the field’s alias in the dictionary key if defined.

  • exclude_unset (bool) – Whether to exclude fields that have not been explicitly set.

  • exclude_defaults (bool) – Whether to exclude fields that are set to their default value.

  • exclude_none (bool) – Whether to exclude fields that have a value of None.

  • exclude_computed_fields (bool) – Whether to exclude computed fields. While this can be useful for round-tripping, it is usually recommended to use the dedicated round_trip parameter instead.

  • round_trip (bool) – If True, dumped values should be valid as input for non-idempotent types such as Json[T].

  • warnings (bool | Literal['none', 'warn', 'error']) – How to handle serialization errors. False/”none” ignores them, True/”warn” logs errors, β€œerror” raises a [PydanticSerializationError][pydantic_core.PydanticSerializationError].

  • fallback (Callable[[Any], Any] | None) – A function to call when an unknown value is encountered. If not provided, a [PydanticSerializationError][pydantic_core.PydanticSerializationError] error is raised.

  • serialize_as_any (bool) – Whether to serialize fields with duck-typing serialization behavior.

  • polymorphic_serialization (bool | None) – Whether to use model and dataclass polymorphic serialization for this call.

Returns:

A dictionary representation of the model.

Return type:

dict[str, Any]

model_dump_json(*, indent=None, ensure_ascii=False, include=None, exclude=None, context=None, by_alias=None, exclude_unset=False, exclude_defaults=False, exclude_none=False, exclude_computed_fields=False, round_trip=False, warnings=True, fallback=None, serialize_as_any=False, polymorphic_serialization=None)ΒΆ
!!! abstract β€œUsage Documentation”

[model_dump_json](../concepts/serialization.md#json-mode)

Generates a JSON representation of the model using Pydantic’s to_json method.

Parameters:
  • indent (int | None) – Indentation to use in the JSON output. If None is passed, the output will be compact.

  • ensure_ascii (bool) – If True, the output is guaranteed to have all incoming non-ASCII characters escaped. If False (the default), these characters will be output as-is.

  • include (set[int] | set[str] | Mapping[int, set[int] | set[str] | Mapping[int, IncEx | bool] | Mapping[str, IncEx | bool] | bool] | Mapping[str, set[int] | set[str] | Mapping[int, IncEx | bool] | Mapping[str, IncEx | bool] | bool] | None) – Field(s) to include in the JSON output.

  • exclude (set[int] | set[str] | Mapping[int, set[int] | set[str] | Mapping[int, IncEx | bool] | Mapping[str, IncEx | bool] | bool] | Mapping[str, set[int] | set[str] | Mapping[int, IncEx | bool] | Mapping[str, IncEx | bool] | bool] | None) – Field(s) to exclude from the JSON output.

  • context (Any | None) – Additional context to pass to the serializer.

  • by_alias (bool | None) – Whether to serialize using field aliases.

  • exclude_unset (bool) – Whether to exclude fields that have not been explicitly set.

  • exclude_defaults (bool) – Whether to exclude fields that are set to their default value.

  • exclude_none (bool) – Whether to exclude fields that have a value of None.

  • exclude_computed_fields (bool) – Whether to exclude computed fields. While this can be useful for round-tripping, it is usually recommended to use the dedicated round_trip parameter instead.

  • round_trip (bool) – If True, dumped values should be valid as input for non-idempotent types such as Json[T].

  • warnings (bool | Literal['none', 'warn', 'error']) – How to handle serialization errors. False/”none” ignores them, True/”warn” logs errors, β€œerror” raises a [PydanticSerializationError][pydantic_core.PydanticSerializationError].

  • fallback (Callable[[Any], Any] | None) – A function to call when an unknown value is encountered. If not provided, a [PydanticSerializationError][pydantic_core.PydanticSerializationError] error is raised.

  • serialize_as_any (bool) – Whether to serialize fields with duck-typing serialization behavior.

  • polymorphic_serialization (bool | None) – Whether to use model and dataclass polymorphic serialization for this call.

Returns:

A JSON string representation of the model.

Return type:

str

property model_extra: dict[str, Any] | NoneΒΆ

Get extra fields set during validation.

Returns:

A dictionary of extra fields, or None if config.extra is not set to β€œallow”.

model_fields = {'association_id': FieldInfo(annotation=str, required=False, default='', description='Parent association identifier.'), 'association_title': FieldInfo(annotation=str, required=False, default='', description='Parent association display name.'), 'id': FieldInfo(annotation=str, required=True, description='Season identifier.'), 'leagueId': FieldInfo(annotation=str, required=False, default='', description='Parent league identifier.'), 'league_id': FieldInfo(annotation=str, required=False, default='', description='League ID from league object.'), 'league_title': FieldInfo(annotation=str, required=False, default='', description='League display name.'), 'stats_year': FieldInfo(annotation=str, required=False, default='', description='Statistics year label.'), 'title': FieldInfo(annotation=str, required=True, description='Display name of the season.')}ΒΆ
property model_fields_set: set[str]ΒΆ

Returns the set of fields that have been explicitly set on this model instance.

Returns:

A set of strings representing the fields that have been set,

i.e. that were not filled from defaults.

classmethod model_json_schema(by_alias=True, ref_template='#/$defs/{model}', schema_generator=<class 'pydantic.json_schema.GenerateJsonSchema'>, mode='validation', *, union_format='any_of')ΒΆ

Generates a JSON schema for a model class.

Parameters:
  • by_alias (bool) – Whether to use attribute aliases or not.

  • ref_template (str) – The reference template.

  • union_format (Literal['any_of', 'primitive_type_array']) –

    The format to use when combining schemas from unions together. Can be one of:

    keyword to combine schemas (the default). - β€˜primitive_type_array’: Use the [type](https://json-schema.org/understanding-json-schema/reference/type) keyword as an array of strings, containing each type of the combination. If any of the schemas is not a primitive type (string, boolean, null, integer or number) or contains constraints/metadata, falls back to any_of.

  • schema_generator (type[GenerateJsonSchema]) – To override the logic used to generate the JSON schema, as a subclass of GenerateJsonSchema with your desired modifications

  • mode (Literal['validation', 'serialization']) – The mode in which to generate the schema.

Returns:

The JSON schema for the given model class.

Return type:

dict[str, Any]

classmethod model_parametrized_name(params)ΒΆ

Compute the class name for parametrizations of generic classes.

This method can be overridden to achieve a custom naming scheme for generic BaseModels.

Parameters:

params (tuple[type[Any], ...]) – Tuple of types of the class. Given a generic class Model with 2 type variables and a concrete model Model[str, int], the value (str, int) would be passed to params.

Returns:

String representing the new class where params are passed to cls as type variables.

Raises:

TypeError – Raised when trying to generate concrete names for non-generic models.

Return type:

str

model_post_init(context, /)ΒΆ

Override this method to perform additional initialization after __init__ and model_construct. This is useful if you want to do some validation that requires the entire model to be initialized.

classmethod model_rebuild(*, force=False, raise_errors=True, _parent_namespace_depth=2, _types_namespace=None)ΒΆ

Try to rebuild the pydantic-core schema for the model.

This may be necessary when one of the annotations is a ForwardRef which could not be resolved during the initial attempt to build the schema, and automatic rebuilding fails.

Parameters:
  • force (bool) – Whether to force the rebuilding of the model schema, defaults to False.

  • raise_errors (bool) – Whether to raise errors, defaults to True.

  • _parent_namespace_depth (int) – The depth level of the parent namespace, defaults to 2.

  • _types_namespace (MappingNamespace | None) – The types namespace, defaults to None.

Returns:

Returns None if the schema is already β€œcomplete” and rebuilding was not required. If rebuilding _was_ required, returns True if rebuilding was successful, otherwise False.

Return type:

bool | None

classmethod model_validate(obj, *, strict=None, extra=None, from_attributes=None, context=None, by_alias=None, by_name=None)ΒΆ

Validate a pydantic model instance.

Parameters:
  • obj (Any) – The object to validate.

  • strict (bool | None) – Whether to enforce types strictly.

  • extra (Literal['allow', 'ignore', 'forbid'] | None) – Whether to ignore, allow, or forbid extra data during model validation. See the [extra configuration value][pydantic.ConfigDict.extra] for details.

  • from_attributes (bool | None) – Whether to extract data from object attributes.

  • context (Any | None) – Additional context to pass to the validator.

  • by_alias (bool | None) – Whether to use the field’s alias when validating against the provided input data.

  • by_name (bool | None) – Whether to use the field’s name when validating against the provided input data.

Raises:

ValidationError – If the object could not be validated.

Returns:

The validated model instance.

Return type:

Self

classmethod model_validate_json(json_data, *, strict=None, extra=None, context=None, by_alias=None, by_name=None)ΒΆ
!!! abstract β€œUsage Documentation”

[JSON Parsing](../concepts/json.md#json-parsing)

Validate the given JSON data against the Pydantic model.

Parameters:
  • json_data (str | bytes | bytearray) – The JSON data to validate.

  • strict (bool | None) – Whether to enforce types strictly.

  • extra (Literal['allow', 'ignore', 'forbid'] | None) – Whether to ignore, allow, or forbid extra data during model validation. See the [extra configuration value][pydantic.ConfigDict.extra] for details.

  • context (Any | None) – Extra variables to pass to the validator.

  • by_alias (bool | None) – Whether to use the field’s alias when validating against the provided input data.

  • by_name (bool | None) – Whether to use the field’s name when validating against the provided input data.

Returns:

The validated Pydantic model.

Raises:

ValidationError – If json_data is not a JSON string or the object could not be validated.

Return type:

Self

classmethod model_validate_strings(obj, *, strict=None, extra=None, context=None, by_alias=None, by_name=None)ΒΆ

Validate the given object with string data against the Pydantic model.

Parameters:
  • obj (Any) – The object containing string data to validate.

  • strict (bool | None) – Whether to enforce types strictly.

  • extra (Literal['allow', 'ignore', 'forbid'] | None) – Whether to ignore, allow, or forbid extra data during model validation. See the [extra configuration value][pydantic.ConfigDict.extra] for details.

  • context (Any | None) – Extra variables to pass to the validator.

  • by_alias (bool | None) – Whether to use the field’s alias when validating against the provided input data.

  • by_name (bool | None) – Whether to use the field’s name when validating against the provided input data.

Returns:

The validated Pydantic model.

Return type:

Self

classmethod parse_file(path, *, content_type=None, encoding='utf8', proto=None, allow_pickle=False)ΒΆ
Return type:

Self

classmethod parse_obj(obj)ΒΆ
Return type:

Self

classmethod parse_raw(b, *, content_type=None, encoding='utf8', proto=None, allow_pickle=False)ΒΆ
Return type:

Self

classmethod schema(by_alias=True, ref_template='#/$defs/{model}')ΒΆ
Return type:

Dict[str, Any]

classmethod schema_json(*, by_alias=True, ref_template='#/$defs/{model}', **dumps_kwargs)ΒΆ
Return type:

str

classmethod update_forward_refs(**localns)ΒΆ
classmethod validate(value)ΒΆ
Return type:

Self

class gamesheet_sdk.teams.SeasonTeam[source]ΒΆ

Bases: BaseModel

A team participating in a season.

idΒΆ

Team identifier.

Type:

str

titleΒΆ

Team display name.

Type:

str

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

model_config = {'extra': 'allow'}ΒΆ

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

id: strΒΆ
title: strΒΆ
__init__(**data)ΒΆ

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

classmethod construct(_fields_set=None, **values)ΒΆ
Return type:

Self

copy(*, include=None, exclude=None, update=None, deep=False)ΒΆ

Returns a copy of the model.

!!! warning β€œDeprecated”

This method is now deprecated; use model_copy instead.

If you need include or exclude, use:

`python {test="skip" lint="skip"} data = self.model_dump(include=include, exclude=exclude, round_trip=True) data = {**data, **(update or {})} copied = self.model_validate(data) `

Parameters:
  • include (AbstractSetIntStr | MappingIntStrAny | None) – Optional set or mapping specifying which fields to include in the copied model.

  • exclude (AbstractSetIntStr | MappingIntStrAny | None) – Optional set or mapping specifying which fields to exclude in the copied model.

  • update (Dict[str, Any] | None) – Optional dictionary of field-value pairs to override field values in the copied model.

  • deep (bool) – If True, the values of fields that are Pydantic models will be deep-copied.

Returns:

A copy of the model with included, excluded and updated fields as specified.

Return type:

Self

dict(*, include=None, exclude=None, by_alias=False, exclude_unset=False, exclude_defaults=False, exclude_none=False)ΒΆ
Return type:

Dict[str, Any]

classmethod from_orm(obj)ΒΆ
Return type:

Self

json(*, include=None, exclude=None, by_alias=False, exclude_unset=False, exclude_defaults=False, exclude_none=False, encoder=PydanticUndefined, models_as_dict=PydanticUndefined, **dumps_kwargs)ΒΆ
Return type:

str

model_computed_fields = {}ΒΆ
classmethod model_construct(_fields_set=None, **values)ΒΆ

Creates a new instance of the Model class with validated data.

Creates a new model setting __dict__ and __pydantic_fields_set__ from trusted or pre-validated data. Default values are respected, but no other validation is performed.

!!! note

model_construct() generally respects the model_config.extra setting on the provided model. That is, if model_config.extra == β€˜allow’, then all extra passed values are added to the model instance’s __dict__ and __pydantic_extra__ fields. If model_config.extra == β€˜ignore’ (the default), then all extra passed values are ignored. Because no validation is performed with a call to model_construct(), having model_config.extra == β€˜forbid’ does not result in an error if extra values are passed, but they will be ignored.

Parameters:
  • _fields_set (set[str] | None) – A set of field names that were originally explicitly set during instantiation. If provided, this is directly used for the [model_fields_set][pydantic.BaseModel.model_fields_set] attribute. Otherwise, the field names from the values argument will be used.

  • values (Any) – Trusted or pre-validated data dictionary.

Returns:

A new instance of the Model class with validated data.

Return type:

Self

model_copy(*, update=None, deep=False)ΒΆ
!!! abstract β€œUsage Documentation”

[model_copy](../concepts/models.md#model-copy)

Returns a copy of the model.

!!! note

The underlying instance’s [__dict__][object.__dict__] attribute is copied. This might have unexpected side effects if you store anything in it, on top of the model fields (e.g. the value of [cached properties][functools.cached_property]).

Parameters:
  • update (Mapping[str, Any] | None) – Values to change/add in the new model. Note: the data is not validated before creating the new model. You should trust this data.

  • deep (bool) – Set to True to make a deep copy of the model.

Returns:

New model instance.

Return type:

Self

model_dump(*, mode='python', include=None, exclude=None, context=None, by_alias=None, exclude_unset=False, exclude_defaults=False, exclude_none=False, exclude_computed_fields=False, round_trip=False, warnings=True, fallback=None, serialize_as_any=False, polymorphic_serialization=None)ΒΆ
!!! abstract β€œUsage Documentation”

[model_dump](../concepts/serialization.md#python-mode)

Generate a dictionary representation of the model, optionally specifying which fields to include or exclude.

Parameters:
  • mode (Literal['json', 'python'] | str) – The mode in which to_python should run. If mode is β€˜json’, the output will only contain JSON serializable types. If mode is β€˜python’, the output may contain non-JSON-serializable Python objects.

  • include (set[int] | set[str] | Mapping[int, set[int] | set[str] | Mapping[int, IncEx | bool] | Mapping[str, IncEx | bool] | bool] | Mapping[str, set[int] | set[str] | Mapping[int, IncEx | bool] | Mapping[str, IncEx | bool] | bool] | None) – A set of fields to include in the output.

  • exclude (set[int] | set[str] | Mapping[int, set[int] | set[str] | Mapping[int, IncEx | bool] | Mapping[str, IncEx | bool] | bool] | Mapping[str, set[int] | set[str] | Mapping[int, IncEx | bool] | Mapping[str, IncEx | bool] | bool] | None) – A set of fields to exclude from the output.

  • context (Any | None) – Additional context to pass to the serializer.

  • by_alias (bool | None) – Whether to use the field’s alias in the dictionary key if defined.

  • exclude_unset (bool) – Whether to exclude fields that have not been explicitly set.

  • exclude_defaults (bool) – Whether to exclude fields that are set to their default value.

  • exclude_none (bool) – Whether to exclude fields that have a value of None.

  • exclude_computed_fields (bool) – Whether to exclude computed fields. While this can be useful for round-tripping, it is usually recommended to use the dedicated round_trip parameter instead.

  • round_trip (bool) – If True, dumped values should be valid as input for non-idempotent types such as Json[T].

  • warnings (bool | Literal['none', 'warn', 'error']) – How to handle serialization errors. False/”none” ignores them, True/”warn” logs errors, β€œerror” raises a [PydanticSerializationError][pydantic_core.PydanticSerializationError].

  • fallback (Callable[[Any], Any] | None) – A function to call when an unknown value is encountered. If not provided, a [PydanticSerializationError][pydantic_core.PydanticSerializationError] error is raised.

  • serialize_as_any (bool) – Whether to serialize fields with duck-typing serialization behavior.

  • polymorphic_serialization (bool | None) – Whether to use model and dataclass polymorphic serialization for this call.

Returns:

A dictionary representation of the model.

Return type:

dict[str, Any]

model_dump_json(*, indent=None, ensure_ascii=False, include=None, exclude=None, context=None, by_alias=None, exclude_unset=False, exclude_defaults=False, exclude_none=False, exclude_computed_fields=False, round_trip=False, warnings=True, fallback=None, serialize_as_any=False, polymorphic_serialization=None)ΒΆ
!!! abstract β€œUsage Documentation”

[model_dump_json](../concepts/serialization.md#json-mode)

Generates a JSON representation of the model using Pydantic’s to_json method.

Parameters:
  • indent (int | None) – Indentation to use in the JSON output. If None is passed, the output will be compact.

  • ensure_ascii (bool) – If True, the output is guaranteed to have all incoming non-ASCII characters escaped. If False (the default), these characters will be output as-is.

  • include (set[int] | set[str] | Mapping[int, set[int] | set[str] | Mapping[int, IncEx | bool] | Mapping[str, IncEx | bool] | bool] | Mapping[str, set[int] | set[str] | Mapping[int, IncEx | bool] | Mapping[str, IncEx | bool] | bool] | None) – Field(s) to include in the JSON output.

  • exclude (set[int] | set[str] | Mapping[int, set[int] | set[str] | Mapping[int, IncEx | bool] | Mapping[str, IncEx | bool] | bool] | Mapping[str, set[int] | set[str] | Mapping[int, IncEx | bool] | Mapping[str, IncEx | bool] | bool] | None) – Field(s) to exclude from the JSON output.

  • context (Any | None) – Additional context to pass to the serializer.

  • by_alias (bool | None) – Whether to serialize using field aliases.

  • exclude_unset (bool) – Whether to exclude fields that have not been explicitly set.

  • exclude_defaults (bool) – Whether to exclude fields that are set to their default value.

  • exclude_none (bool) – Whether to exclude fields that have a value of None.

  • exclude_computed_fields (bool) – Whether to exclude computed fields. While this can be useful for round-tripping, it is usually recommended to use the dedicated round_trip parameter instead.

  • round_trip (bool) – If True, dumped values should be valid as input for non-idempotent types such as Json[T].

  • warnings (bool | Literal['none', 'warn', 'error']) – How to handle serialization errors. False/”none” ignores them, True/”warn” logs errors, β€œerror” raises a [PydanticSerializationError][pydantic_core.PydanticSerializationError].

  • fallback (Callable[[Any], Any] | None) – A function to call when an unknown value is encountered. If not provided, a [PydanticSerializationError][pydantic_core.PydanticSerializationError] error is raised.

  • serialize_as_any (bool) – Whether to serialize fields with duck-typing serialization behavior.

  • polymorphic_serialization (bool | None) – Whether to use model and dataclass polymorphic serialization for this call.

Returns:

A JSON string representation of the model.

Return type:

str

property model_extra: dict[str, Any] | NoneΒΆ

Get extra fields set during validation.

Returns:

A dictionary of extra fields, or None if config.extra is not set to β€œallow”.

model_fields = {'id': FieldInfo(annotation=str, required=False, default='', description='Team identifier.'), 'title': FieldInfo(annotation=str, required=False, default='', description='Team display name.')}ΒΆ
property model_fields_set: set[str]ΒΆ

Returns the set of fields that have been explicitly set on this model instance.

Returns:

A set of strings representing the fields that have been set,

i.e. that were not filled from defaults.

classmethod model_json_schema(by_alias=True, ref_template='#/$defs/{model}', schema_generator=<class 'pydantic.json_schema.GenerateJsonSchema'>, mode='validation', *, union_format='any_of')ΒΆ

Generates a JSON schema for a model class.

Parameters:
  • by_alias (bool) – Whether to use attribute aliases or not.

  • ref_template (str) – The reference template.

  • union_format (Literal['any_of', 'primitive_type_array']) –

    The format to use when combining schemas from unions together. Can be one of:

    keyword to combine schemas (the default). - β€˜primitive_type_array’: Use the [type](https://json-schema.org/understanding-json-schema/reference/type) keyword as an array of strings, containing each type of the combination. If any of the schemas is not a primitive type (string, boolean, null, integer or number) or contains constraints/metadata, falls back to any_of.

  • schema_generator (type[GenerateJsonSchema]) – To override the logic used to generate the JSON schema, as a subclass of GenerateJsonSchema with your desired modifications

  • mode (Literal['validation', 'serialization']) – The mode in which to generate the schema.

Returns:

The JSON schema for the given model class.

Return type:

dict[str, Any]

classmethod model_parametrized_name(params)ΒΆ

Compute the class name for parametrizations of generic classes.

This method can be overridden to achieve a custom naming scheme for generic BaseModels.

Parameters:

params (tuple[type[Any], ...]) – Tuple of types of the class. Given a generic class Model with 2 type variables and a concrete model Model[str, int], the value (str, int) would be passed to params.

Returns:

String representing the new class where params are passed to cls as type variables.

Raises:

TypeError – Raised when trying to generate concrete names for non-generic models.

Return type:

str

model_post_init(context, /)ΒΆ

Override this method to perform additional initialization after __init__ and model_construct. This is useful if you want to do some validation that requires the entire model to be initialized.

classmethod model_rebuild(*, force=False, raise_errors=True, _parent_namespace_depth=2, _types_namespace=None)ΒΆ

Try to rebuild the pydantic-core schema for the model.

This may be necessary when one of the annotations is a ForwardRef which could not be resolved during the initial attempt to build the schema, and automatic rebuilding fails.

Parameters:
  • force (bool) – Whether to force the rebuilding of the model schema, defaults to False.

  • raise_errors (bool) – Whether to raise errors, defaults to True.

  • _parent_namespace_depth (int) – The depth level of the parent namespace, defaults to 2.

  • _types_namespace (MappingNamespace | None) – The types namespace, defaults to None.

Returns:

Returns None if the schema is already β€œcomplete” and rebuilding was not required. If rebuilding _was_ required, returns True if rebuilding was successful, otherwise False.

Return type:

bool | None

classmethod model_validate(obj, *, strict=None, extra=None, from_attributes=None, context=None, by_alias=None, by_name=None)ΒΆ

Validate a pydantic model instance.

Parameters:
  • obj (Any) – The object to validate.

  • strict (bool | None) – Whether to enforce types strictly.

  • extra (Literal['allow', 'ignore', 'forbid'] | None) – Whether to ignore, allow, or forbid extra data during model validation. See the [extra configuration value][pydantic.ConfigDict.extra] for details.

  • from_attributes (bool | None) – Whether to extract data from object attributes.

  • context (Any | None) – Additional context to pass to the validator.

  • by_alias (bool | None) – Whether to use the field’s alias when validating against the provided input data.

  • by_name (bool | None) – Whether to use the field’s name when validating against the provided input data.

Raises:

ValidationError – If the object could not be validated.

Returns:

The validated model instance.

Return type:

Self

classmethod model_validate_json(json_data, *, strict=None, extra=None, context=None, by_alias=None, by_name=None)ΒΆ
!!! abstract β€œUsage Documentation”

[JSON Parsing](../concepts/json.md#json-parsing)

Validate the given JSON data against the Pydantic model.

Parameters:
  • json_data (str | bytes | bytearray) – The JSON data to validate.

  • strict (bool | None) – Whether to enforce types strictly.

  • extra (Literal['allow', 'ignore', 'forbid'] | None) – Whether to ignore, allow, or forbid extra data during model validation. See the [extra configuration value][pydantic.ConfigDict.extra] for details.

  • context (Any | None) – Extra variables to pass to the validator.

  • by_alias (bool | None) – Whether to use the field’s alias when validating against the provided input data.

  • by_name (bool | None) – Whether to use the field’s name when validating against the provided input data.

Returns:

The validated Pydantic model.

Raises:

ValidationError – If json_data is not a JSON string or the object could not be validated.

Return type:

Self

classmethod model_validate_strings(obj, *, strict=None, extra=None, context=None, by_alias=None, by_name=None)ΒΆ

Validate the given object with string data against the Pydantic model.

Parameters:
  • obj (Any) – The object containing string data to validate.

  • strict (bool | None) – Whether to enforce types strictly.

  • extra (Literal['allow', 'ignore', 'forbid'] | None) – Whether to ignore, allow, or forbid extra data during model validation. See the [extra configuration value][pydantic.ConfigDict.extra] for details.

  • context (Any | None) – Extra variables to pass to the validator.

  • by_alias (bool | None) – Whether to use the field’s alias when validating against the provided input data.

  • by_name (bool | None) – Whether to use the field’s name when validating against the provided input data.

Returns:

The validated Pydantic model.

Return type:

Self

classmethod parse_file(path, *, content_type=None, encoding='utf8', proto=None, allow_pickle=False)ΒΆ
Return type:

Self

classmethod parse_obj(obj)ΒΆ
Return type:

Self

classmethod parse_raw(b, *, content_type=None, encoding='utf8', proto=None, allow_pickle=False)ΒΆ
Return type:

Self

classmethod schema(by_alias=True, ref_template='#/$defs/{model}')ΒΆ
Return type:

Dict[str, Any]

classmethod schema_json(*, by_alias=True, ref_template='#/$defs/{model}', **dumps_kwargs)ΒΆ
Return type:

str

classmethod update_forward_refs(**localns)ΒΆ
classmethod validate(value)ΒΆ
Return type:

Self

class gamesheet_sdk.teams.TeamDetail[source]ΒΆ

Bases: BaseModel

Detailed information for a single team.

teamIdΒΆ

Team identifier.

Type:

str | int | None

teamNameΒΆ

Name of the team.

Type:

str | None

statusΒΆ

Team status.

Type:

str | None

relationshipΒΆ

User’s relationship to the team.

Type:

str | None

memberIdΒΆ

Member identifier.

Type:

str | int | None

clubIdΒΆ

Parent club/association identifier.

Type:

str | int | None

ageCategoryΒΆ

Age category of the team.

Type:

str | None

statsYearΒΆ

Statistics year.

Type:

str | int | None

joinedAtΒΆ

Timestamp when joined.

Type:

str | None

onboardingCompletedAtΒΆ

Timestamp when onboarding completed.

Type:

str | None

URL of the team logo.

Type:

str | None

skillΒΆ

Skill level of the team.

Type:

str | None

provinceΒΆ

Province or state code of the team.

Type:

str | None

isArchivedΒΆ

Whether the team is archived.

Type:

bool | None

seasonTeamsUpdatedΒΆ

Count of season team instances updated.

Type:

int | None

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

model_config = {'extra': 'allow'}ΒΆ

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

teamId: str | int | NoneΒΆ
teamName: str | NoneΒΆ
status: str | NoneΒΆ
relationship: str | NoneΒΆ
memberId: str | int | NoneΒΆ
clubId: str | int | NoneΒΆ
ageCategory: str | NoneΒΆ
statsYear: str | int | NoneΒΆ
joinedAt: str | NoneΒΆ
onboardingCompletedAt: str | NoneΒΆ
teamLogo: str | NoneΒΆ
skill: str | NoneΒΆ
province: str | NoneΒΆ
isArchived: bool | NoneΒΆ
seasonTeamsUpdated: int | NoneΒΆ
__init__(**data)ΒΆ

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

classmethod construct(_fields_set=None, **values)ΒΆ
Return type:

Self

copy(*, include=None, exclude=None, update=None, deep=False)ΒΆ

Returns a copy of the model.

!!! warning β€œDeprecated”

This method is now deprecated; use model_copy instead.

If you need include or exclude, use:

`python {test="skip" lint="skip"} data = self.model_dump(include=include, exclude=exclude, round_trip=True) data = {**data, **(update or {})} copied = self.model_validate(data) `

Parameters:
  • include (AbstractSetIntStr | MappingIntStrAny | None) – Optional set or mapping specifying which fields to include in the copied model.

  • exclude (AbstractSetIntStr | MappingIntStrAny | None) – Optional set or mapping specifying which fields to exclude in the copied model.

  • update (Dict[str, Any] | None) – Optional dictionary of field-value pairs to override field values in the copied model.

  • deep (bool) – If True, the values of fields that are Pydantic models will be deep-copied.

Returns:

A copy of the model with included, excluded and updated fields as specified.

Return type:

Self

dict(*, include=None, exclude=None, by_alias=False, exclude_unset=False, exclude_defaults=False, exclude_none=False)ΒΆ
Return type:

Dict[str, Any]

classmethod from_orm(obj)ΒΆ
Return type:

Self

json(*, include=None, exclude=None, by_alias=False, exclude_unset=False, exclude_defaults=False, exclude_none=False, encoder=PydanticUndefined, models_as_dict=PydanticUndefined, **dumps_kwargs)ΒΆ
Return type:

str

model_computed_fields = {}ΒΆ
classmethod model_construct(_fields_set=None, **values)ΒΆ

Creates a new instance of the Model class with validated data.

Creates a new model setting __dict__ and __pydantic_fields_set__ from trusted or pre-validated data. Default values are respected, but no other validation is performed.

!!! note

model_construct() generally respects the model_config.extra setting on the provided model. That is, if model_config.extra == β€˜allow’, then all extra passed values are added to the model instance’s __dict__ and __pydantic_extra__ fields. If model_config.extra == β€˜ignore’ (the default), then all extra passed values are ignored. Because no validation is performed with a call to model_construct(), having model_config.extra == β€˜forbid’ does not result in an error if extra values are passed, but they will be ignored.

Parameters:
  • _fields_set (set[str] | None) – A set of field names that were originally explicitly set during instantiation. If provided, this is directly used for the [model_fields_set][pydantic.BaseModel.model_fields_set] attribute. Otherwise, the field names from the values argument will be used.

  • values (Any) – Trusted or pre-validated data dictionary.

Returns:

A new instance of the Model class with validated data.

Return type:

Self

model_copy(*, update=None, deep=False)ΒΆ
!!! abstract β€œUsage Documentation”

[model_copy](../concepts/models.md#model-copy)

Returns a copy of the model.

!!! note

The underlying instance’s [__dict__][object.__dict__] attribute is copied. This might have unexpected side effects if you store anything in it, on top of the model fields (e.g. the value of [cached properties][functools.cached_property]).

Parameters:
  • update (Mapping[str, Any] | None) – Values to change/add in the new model. Note: the data is not validated before creating the new model. You should trust this data.

  • deep (bool) – Set to True to make a deep copy of the model.

Returns:

New model instance.

Return type:

Self

model_dump(*, mode='python', include=None, exclude=None, context=None, by_alias=None, exclude_unset=False, exclude_defaults=False, exclude_none=False, exclude_computed_fields=False, round_trip=False, warnings=True, fallback=None, serialize_as_any=False, polymorphic_serialization=None)ΒΆ
!!! abstract β€œUsage Documentation”

[model_dump](../concepts/serialization.md#python-mode)

Generate a dictionary representation of the model, optionally specifying which fields to include or exclude.

Parameters:
  • mode (Literal['json', 'python'] | str) – The mode in which to_python should run. If mode is β€˜json’, the output will only contain JSON serializable types. If mode is β€˜python’, the output may contain non-JSON-serializable Python objects.

  • include (set[int] | set[str] | Mapping[int, set[int] | set[str] | Mapping[int, IncEx | bool] | Mapping[str, IncEx | bool] | bool] | Mapping[str, set[int] | set[str] | Mapping[int, IncEx | bool] | Mapping[str, IncEx | bool] | bool] | None) – A set of fields to include in the output.

  • exclude (set[int] | set[str] | Mapping[int, set[int] | set[str] | Mapping[int, IncEx | bool] | Mapping[str, IncEx | bool] | bool] | Mapping[str, set[int] | set[str] | Mapping[int, IncEx | bool] | Mapping[str, IncEx | bool] | bool] | None) – A set of fields to exclude from the output.

  • context (Any | None) – Additional context to pass to the serializer.

  • by_alias (bool | None) – Whether to use the field’s alias in the dictionary key if defined.

  • exclude_unset (bool) – Whether to exclude fields that have not been explicitly set.

  • exclude_defaults (bool) – Whether to exclude fields that are set to their default value.

  • exclude_none (bool) – Whether to exclude fields that have a value of None.

  • exclude_computed_fields (bool) – Whether to exclude computed fields. While this can be useful for round-tripping, it is usually recommended to use the dedicated round_trip parameter instead.

  • round_trip (bool) – If True, dumped values should be valid as input for non-idempotent types such as Json[T].

  • warnings (bool | Literal['none', 'warn', 'error']) – How to handle serialization errors. False/”none” ignores them, True/”warn” logs errors, β€œerror” raises a [PydanticSerializationError][pydantic_core.PydanticSerializationError].

  • fallback (Callable[[Any], Any] | None) – A function to call when an unknown value is encountered. If not provided, a [PydanticSerializationError][pydantic_core.PydanticSerializationError] error is raised.

  • serialize_as_any (bool) – Whether to serialize fields with duck-typing serialization behavior.

  • polymorphic_serialization (bool | None) – Whether to use model and dataclass polymorphic serialization for this call.

Returns:

A dictionary representation of the model.

Return type:

dict[str, Any]

model_dump_json(*, indent=None, ensure_ascii=False, include=None, exclude=None, context=None, by_alias=None, exclude_unset=False, exclude_defaults=False, exclude_none=False, exclude_computed_fields=False, round_trip=False, warnings=True, fallback=None, serialize_as_any=False, polymorphic_serialization=None)ΒΆ
!!! abstract β€œUsage Documentation”

[model_dump_json](../concepts/serialization.md#json-mode)

Generates a JSON representation of the model using Pydantic’s to_json method.

Parameters:
  • indent (int | None) – Indentation to use in the JSON output. If None is passed, the output will be compact.

  • ensure_ascii (bool) – If True, the output is guaranteed to have all incoming non-ASCII characters escaped. If False (the default), these characters will be output as-is.

  • include (set[int] | set[str] | Mapping[int, set[int] | set[str] | Mapping[int, IncEx | bool] | Mapping[str, IncEx | bool] | bool] | Mapping[str, set[int] | set[str] | Mapping[int, IncEx | bool] | Mapping[str, IncEx | bool] | bool] | None) – Field(s) to include in the JSON output.

  • exclude (set[int] | set[str] | Mapping[int, set[int] | set[str] | Mapping[int, IncEx | bool] | Mapping[str, IncEx | bool] | bool] | Mapping[str, set[int] | set[str] | Mapping[int, IncEx | bool] | Mapping[str, IncEx | bool] | bool] | None) – Field(s) to exclude from the JSON output.

  • context (Any | None) – Additional context to pass to the serializer.

  • by_alias (bool | None) – Whether to serialize using field aliases.

  • exclude_unset (bool) – Whether to exclude fields that have not been explicitly set.

  • exclude_defaults (bool) – Whether to exclude fields that are set to their default value.

  • exclude_none (bool) – Whether to exclude fields that have a value of None.

  • exclude_computed_fields (bool) – Whether to exclude computed fields. While this can be useful for round-tripping, it is usually recommended to use the dedicated round_trip parameter instead.

  • round_trip (bool) – If True, dumped values should be valid as input for non-idempotent types such as Json[T].

  • warnings (bool | Literal['none', 'warn', 'error']) – How to handle serialization errors. False/”none” ignores them, True/”warn” logs errors, β€œerror” raises a [PydanticSerializationError][pydantic_core.PydanticSerializationError].

  • fallback (Callable[[Any], Any] | None) – A function to call when an unknown value is encountered. If not provided, a [PydanticSerializationError][pydantic_core.PydanticSerializationError] error is raised.

  • serialize_as_any (bool) – Whether to serialize fields with duck-typing serialization behavior.

  • polymorphic_serialization (bool | None) – Whether to use model and dataclass polymorphic serialization for this call.

Returns:

A JSON string representation of the model.

Return type:

str

property model_extra: dict[str, Any] | NoneΒΆ

Get extra fields set during validation.

Returns:

A dictionary of extra fields, or None if config.extra is not set to β€œallow”.

model_fields = {'ageCategory': FieldInfo(annotation=Union[str, NoneType], required=False, default=None, description='Age category of the team.'), 'clubId': FieldInfo(annotation=Union[str, int, NoneType], required=False, default=None, description='Parent club/association identifier.'), 'isArchived': FieldInfo(annotation=Union[bool, NoneType], required=False, default=None, description='Whether the team is archived.'), 'joinedAt': FieldInfo(annotation=Union[str, NoneType], required=False, default=None, description='Timestamp when joined.'), 'memberId': FieldInfo(annotation=Union[str, int, NoneType], required=False, default=None, description='Member identifier.'), 'onboardingCompletedAt': FieldInfo(annotation=Union[str, NoneType], required=False, default=None, description='Timestamp when onboarding completed.'), 'province': FieldInfo(annotation=Union[str, NoneType], required=False, default=None, description='Province or state code of the team.'), 'relationship': FieldInfo(annotation=Union[str, NoneType], required=False, default=None, description="User's relationship to the team."), 'seasonTeamsUpdated': FieldInfo(annotation=Union[int, NoneType], required=False, default=None, description='Count of season team instances updated.'), 'skill': FieldInfo(annotation=Union[str, NoneType], required=False, default=None, description='Skill level of the team.'), 'statsYear': FieldInfo(annotation=Union[str, int, NoneType], required=False, default=None, description='Statistics year.'), 'status': FieldInfo(annotation=Union[str, NoneType], required=False, default=None, description='Team status.'), 'teamId': FieldInfo(annotation=Union[str, int, NoneType], required=False, default=None, description='Team identifier.'), 'teamLogo': FieldInfo(annotation=Union[str, NoneType], required=False, default=None, description='URL of the team logo.'), 'teamName': FieldInfo(annotation=Union[str, NoneType], required=False, default=None, description='Name of the team.')}ΒΆ
property model_fields_set: set[str]ΒΆ

Returns the set of fields that have been explicitly set on this model instance.

Returns:

A set of strings representing the fields that have been set,

i.e. that were not filled from defaults.

classmethod model_json_schema(by_alias=True, ref_template='#/$defs/{model}', schema_generator=<class 'pydantic.json_schema.GenerateJsonSchema'>, mode='validation', *, union_format='any_of')ΒΆ

Generates a JSON schema for a model class.

Parameters:
  • by_alias (bool) – Whether to use attribute aliases or not.

  • ref_template (str) – The reference template.

  • union_format (Literal['any_of', 'primitive_type_array']) –

    The format to use when combining schemas from unions together. Can be one of:

    keyword to combine schemas (the default). - β€˜primitive_type_array’: Use the [type](https://json-schema.org/understanding-json-schema/reference/type) keyword as an array of strings, containing each type of the combination. If any of the schemas is not a primitive type (string, boolean, null, integer or number) or contains constraints/metadata, falls back to any_of.

  • schema_generator (type[GenerateJsonSchema]) – To override the logic used to generate the JSON schema, as a subclass of GenerateJsonSchema with your desired modifications

  • mode (Literal['validation', 'serialization']) – The mode in which to generate the schema.

Returns:

The JSON schema for the given model class.

Return type:

dict[str, Any]

classmethod model_parametrized_name(params)ΒΆ

Compute the class name for parametrizations of generic classes.

This method can be overridden to achieve a custom naming scheme for generic BaseModels.

Parameters:

params (tuple[type[Any], ...]) – Tuple of types of the class. Given a generic class Model with 2 type variables and a concrete model Model[str, int], the value (str, int) would be passed to params.

Returns:

String representing the new class where params are passed to cls as type variables.

Raises:

TypeError – Raised when trying to generate concrete names for non-generic models.

Return type:

str

model_post_init(context, /)ΒΆ

Override this method to perform additional initialization after __init__ and model_construct. This is useful if you want to do some validation that requires the entire model to be initialized.

classmethod model_rebuild(*, force=False, raise_errors=True, _parent_namespace_depth=2, _types_namespace=None)ΒΆ

Try to rebuild the pydantic-core schema for the model.

This may be necessary when one of the annotations is a ForwardRef which could not be resolved during the initial attempt to build the schema, and automatic rebuilding fails.

Parameters:
  • force (bool) – Whether to force the rebuilding of the model schema, defaults to False.

  • raise_errors (bool) – Whether to raise errors, defaults to True.

  • _parent_namespace_depth (int) – The depth level of the parent namespace, defaults to 2.

  • _types_namespace (MappingNamespace | None) – The types namespace, defaults to None.

Returns:

Returns None if the schema is already β€œcomplete” and rebuilding was not required. If rebuilding _was_ required, returns True if rebuilding was successful, otherwise False.

Return type:

bool | None

classmethod model_validate(obj, *, strict=None, extra=None, from_attributes=None, context=None, by_alias=None, by_name=None)ΒΆ

Validate a pydantic model instance.

Parameters:
  • obj (Any) – The object to validate.

  • strict (bool | None) – Whether to enforce types strictly.

  • extra (Literal['allow', 'ignore', 'forbid'] | None) – Whether to ignore, allow, or forbid extra data during model validation. See the [extra configuration value][pydantic.ConfigDict.extra] for details.

  • from_attributes (bool | None) – Whether to extract data from object attributes.

  • context (Any | None) – Additional context to pass to the validator.

  • by_alias (bool | None) – Whether to use the field’s alias when validating against the provided input data.

  • by_name (bool | None) – Whether to use the field’s name when validating against the provided input data.

Raises:

ValidationError – If the object could not be validated.

Returns:

The validated model instance.

Return type:

Self

classmethod model_validate_json(json_data, *, strict=None, extra=None, context=None, by_alias=None, by_name=None)ΒΆ
!!! abstract β€œUsage Documentation”

[JSON Parsing](../concepts/json.md#json-parsing)

Validate the given JSON data against the Pydantic model.

Parameters:
  • json_data (str | bytes | bytearray) – The JSON data to validate.

  • strict (bool | None) – Whether to enforce types strictly.

  • extra (Literal['allow', 'ignore', 'forbid'] | None) – Whether to ignore, allow, or forbid extra data during model validation. See the [extra configuration value][pydantic.ConfigDict.extra] for details.

  • context (Any | None) – Extra variables to pass to the validator.

  • by_alias (bool | None) – Whether to use the field’s alias when validating against the provided input data.

  • by_name (bool | None) – Whether to use the field’s name when validating against the provided input data.

Returns:

The validated Pydantic model.

Raises:

ValidationError – If json_data is not a JSON string or the object could not be validated.

Return type:

Self

classmethod model_validate_strings(obj, *, strict=None, extra=None, context=None, by_alias=None, by_name=None)ΒΆ

Validate the given object with string data against the Pydantic model.

Parameters:
  • obj (Any) – The object containing string data to validate.

  • strict (bool | None) – Whether to enforce types strictly.

  • extra (Literal['allow', 'ignore', 'forbid'] | None) – Whether to ignore, allow, or forbid extra data during model validation. See the [extra configuration value][pydantic.ConfigDict.extra] for details.

  • context (Any | None) – Extra variables to pass to the validator.

  • by_alias (bool | None) – Whether to use the field’s alias when validating against the provided input data.

  • by_name (bool | None) – Whether to use the field’s name when validating against the provided input data.

Returns:

The validated Pydantic model.

Return type:

Self

classmethod parse_file(path, *, content_type=None, encoding='utf8', proto=None, allow_pickle=False)ΒΆ
Return type:

Self

classmethod parse_obj(obj)ΒΆ
Return type:

Self

classmethod parse_raw(b, *, content_type=None, encoding='utf8', proto=None, allow_pickle=False)ΒΆ
Return type:

Self

classmethod schema(by_alias=True, ref_template='#/$defs/{model}')ΒΆ
Return type:

Dict[str, Any]

classmethod schema_json(*, by_alias=True, ref_template='#/$defs/{model}', **dumps_kwargs)ΒΆ
Return type:

str

classmethod update_forward_refs(**localns)ΒΆ
classmethod validate(value)ΒΆ
Return type:

Self

class gamesheet_sdk.teams.TeamSummary[source]ΒΆ

Bases: BaseModel

Summary of a team for list views.

memberIdΒΆ

Member identifier.

Type:

str | int | None

teamIdΒΆ

Team identifier.

Type:

str | int | None

relationshipΒΆ

User’s relationship to the team.

Type:

str | None

statusΒΆ

Team status.

Type:

str | None

onboardingCompletedAtΒΆ

Timestamp when onboarding was completed.

Type:

str | None

teamNameΒΆ

Name of the team.

Type:

str | None

ageCategoryΒΆ

Age category of the team.

Type:

str | None

clubIdΒΆ

Parent club/association identifier.

Type:

str | int | None

joinedAtΒΆ

Timestamp when the user joined the team.

Type:

str | None

statsYearΒΆ

Statistics year.

Type:

str | int | None

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

model_config = {'extra': 'allow'}ΒΆ

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

memberId: str | int | NoneΒΆ
teamId: str | int | NoneΒΆ
relationship: str | NoneΒΆ
status: str | NoneΒΆ
onboardingCompletedAt: str | NoneΒΆ
teamName: str | NoneΒΆ
ageCategory: str | NoneΒΆ
clubId: str | int | NoneΒΆ
joinedAt: str | NoneΒΆ
statsYear: str | int | NoneΒΆ
__init__(**data)ΒΆ

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

classmethod construct(_fields_set=None, **values)ΒΆ
Return type:

Self

copy(*, include=None, exclude=None, update=None, deep=False)ΒΆ

Returns a copy of the model.

!!! warning β€œDeprecated”

This method is now deprecated; use model_copy instead.

If you need include or exclude, use:

`python {test="skip" lint="skip"} data = self.model_dump(include=include, exclude=exclude, round_trip=True) data = {**data, **(update or {})} copied = self.model_validate(data) `

Parameters:
  • include (AbstractSetIntStr | MappingIntStrAny | None) – Optional set or mapping specifying which fields to include in the copied model.

  • exclude (AbstractSetIntStr | MappingIntStrAny | None) – Optional set or mapping specifying which fields to exclude in the copied model.

  • update (Dict[str, Any] | None) – Optional dictionary of field-value pairs to override field values in the copied model.

  • deep (bool) – If True, the values of fields that are Pydantic models will be deep-copied.

Returns:

A copy of the model with included, excluded and updated fields as specified.

Return type:

Self

dict(*, include=None, exclude=None, by_alias=False, exclude_unset=False, exclude_defaults=False, exclude_none=False)ΒΆ
Return type:

Dict[str, Any]

classmethod from_orm(obj)ΒΆ
Return type:

Self

json(*, include=None, exclude=None, by_alias=False, exclude_unset=False, exclude_defaults=False, exclude_none=False, encoder=PydanticUndefined, models_as_dict=PydanticUndefined, **dumps_kwargs)ΒΆ
Return type:

str

model_computed_fields = {}ΒΆ
classmethod model_construct(_fields_set=None, **values)ΒΆ

Creates a new instance of the Model class with validated data.

Creates a new model setting __dict__ and __pydantic_fields_set__ from trusted or pre-validated data. Default values are respected, but no other validation is performed.

!!! note

model_construct() generally respects the model_config.extra setting on the provided model. That is, if model_config.extra == β€˜allow’, then all extra passed values are added to the model instance’s __dict__ and __pydantic_extra__ fields. If model_config.extra == β€˜ignore’ (the default), then all extra passed values are ignored. Because no validation is performed with a call to model_construct(), having model_config.extra == β€˜forbid’ does not result in an error if extra values are passed, but they will be ignored.

Parameters:
  • _fields_set (set[str] | None) – A set of field names that were originally explicitly set during instantiation. If provided, this is directly used for the [model_fields_set][pydantic.BaseModel.model_fields_set] attribute. Otherwise, the field names from the values argument will be used.

  • values (Any) – Trusted or pre-validated data dictionary.

Returns:

A new instance of the Model class with validated data.

Return type:

Self

model_copy(*, update=None, deep=False)ΒΆ
!!! abstract β€œUsage Documentation”

[model_copy](../concepts/models.md#model-copy)

Returns a copy of the model.

!!! note

The underlying instance’s [__dict__][object.__dict__] attribute is copied. This might have unexpected side effects if you store anything in it, on top of the model fields (e.g. the value of [cached properties][functools.cached_property]).

Parameters:
  • update (Mapping[str, Any] | None) – Values to change/add in the new model. Note: the data is not validated before creating the new model. You should trust this data.

  • deep (bool) – Set to True to make a deep copy of the model.

Returns:

New model instance.

Return type:

Self

model_dump(*, mode='python', include=None, exclude=None, context=None, by_alias=None, exclude_unset=False, exclude_defaults=False, exclude_none=False, exclude_computed_fields=False, round_trip=False, warnings=True, fallback=None, serialize_as_any=False, polymorphic_serialization=None)ΒΆ
!!! abstract β€œUsage Documentation”

[model_dump](../concepts/serialization.md#python-mode)

Generate a dictionary representation of the model, optionally specifying which fields to include or exclude.

Parameters:
  • mode (Literal['json', 'python'] | str) – The mode in which to_python should run. If mode is β€˜json’, the output will only contain JSON serializable types. If mode is β€˜python’, the output may contain non-JSON-serializable Python objects.

  • include (set[int] | set[str] | Mapping[int, set[int] | set[str] | Mapping[int, IncEx | bool] | Mapping[str, IncEx | bool] | bool] | Mapping[str, set[int] | set[str] | Mapping[int, IncEx | bool] | Mapping[str, IncEx | bool] | bool] | None) – A set of fields to include in the output.

  • exclude (set[int] | set[str] | Mapping[int, set[int] | set[str] | Mapping[int, IncEx | bool] | Mapping[str, IncEx | bool] | bool] | Mapping[str, set[int] | set[str] | Mapping[int, IncEx | bool] | Mapping[str, IncEx | bool] | bool] | None) – A set of fields to exclude from the output.

  • context (Any | None) – Additional context to pass to the serializer.

  • by_alias (bool | None) – Whether to use the field’s alias in the dictionary key if defined.

  • exclude_unset (bool) – Whether to exclude fields that have not been explicitly set.

  • exclude_defaults (bool) – Whether to exclude fields that are set to their default value.

  • exclude_none (bool) – Whether to exclude fields that have a value of None.

  • exclude_computed_fields (bool) – Whether to exclude computed fields. While this can be useful for round-tripping, it is usually recommended to use the dedicated round_trip parameter instead.

  • round_trip (bool) – If True, dumped values should be valid as input for non-idempotent types such as Json[T].

  • warnings (bool | Literal['none', 'warn', 'error']) – How to handle serialization errors. False/”none” ignores them, True/”warn” logs errors, β€œerror” raises a [PydanticSerializationError][pydantic_core.PydanticSerializationError].

  • fallback (Callable[[Any], Any] | None) – A function to call when an unknown value is encountered. If not provided, a [PydanticSerializationError][pydantic_core.PydanticSerializationError] error is raised.

  • serialize_as_any (bool) – Whether to serialize fields with duck-typing serialization behavior.

  • polymorphic_serialization (bool | None) – Whether to use model and dataclass polymorphic serialization for this call.

Returns:

A dictionary representation of the model.

Return type:

dict[str, Any]

model_dump_json(*, indent=None, ensure_ascii=False, include=None, exclude=None, context=None, by_alias=None, exclude_unset=False, exclude_defaults=False, exclude_none=False, exclude_computed_fields=False, round_trip=False, warnings=True, fallback=None, serialize_as_any=False, polymorphic_serialization=None)ΒΆ
!!! abstract β€œUsage Documentation”

[model_dump_json](../concepts/serialization.md#json-mode)

Generates a JSON representation of the model using Pydantic’s to_json method.

Parameters:
  • indent (int | None) – Indentation to use in the JSON output. If None is passed, the output will be compact.

  • ensure_ascii (bool) – If True, the output is guaranteed to have all incoming non-ASCII characters escaped. If False (the default), these characters will be output as-is.

  • include (set[int] | set[str] | Mapping[int, set[int] | set[str] | Mapping[int, IncEx | bool] | Mapping[str, IncEx | bool] | bool] | Mapping[str, set[int] | set[str] | Mapping[int, IncEx | bool] | Mapping[str, IncEx | bool] | bool] | None) – Field(s) to include in the JSON output.

  • exclude (set[int] | set[str] | Mapping[int, set[int] | set[str] | Mapping[int, IncEx | bool] | Mapping[str, IncEx | bool] | bool] | Mapping[str, set[int] | set[str] | Mapping[int, IncEx | bool] | Mapping[str, IncEx | bool] | bool] | None) – Field(s) to exclude from the JSON output.

  • context (Any | None) – Additional context to pass to the serializer.

  • by_alias (bool | None) – Whether to serialize using field aliases.

  • exclude_unset (bool) – Whether to exclude fields that have not been explicitly set.

  • exclude_defaults (bool) – Whether to exclude fields that are set to their default value.

  • exclude_none (bool) – Whether to exclude fields that have a value of None.

  • exclude_computed_fields (bool) – Whether to exclude computed fields. While this can be useful for round-tripping, it is usually recommended to use the dedicated round_trip parameter instead.

  • round_trip (bool) – If True, dumped values should be valid as input for non-idempotent types such as Json[T].

  • warnings (bool | Literal['none', 'warn', 'error']) – How to handle serialization errors. False/”none” ignores them, True/”warn” logs errors, β€œerror” raises a [PydanticSerializationError][pydantic_core.PydanticSerializationError].

  • fallback (Callable[[Any], Any] | None) – A function to call when an unknown value is encountered. If not provided, a [PydanticSerializationError][pydantic_core.PydanticSerializationError] error is raised.

  • serialize_as_any (bool) – Whether to serialize fields with duck-typing serialization behavior.

  • polymorphic_serialization (bool | None) – Whether to use model and dataclass polymorphic serialization for this call.

Returns:

A JSON string representation of the model.

Return type:

str

property model_extra: dict[str, Any] | NoneΒΆ

Get extra fields set during validation.

Returns:

A dictionary of extra fields, or None if config.extra is not set to β€œallow”.

model_fields = {'ageCategory': FieldInfo(annotation=Union[str, NoneType], required=False, default=None, description='Age category of the team.'), 'clubId': FieldInfo(annotation=Union[str, int, NoneType], required=False, default=None, description='Parent club/association identifier.'), 'joinedAt': FieldInfo(annotation=Union[str, NoneType], required=False, default=None, description='Timestamp when the user joined the team.'), 'memberId': FieldInfo(annotation=Union[str, int, NoneType], required=False, default=None, description='Member identifier.'), 'onboardingCompletedAt': FieldInfo(annotation=Union[str, NoneType], required=False, default=None, description='Timestamp when onboarding was completed.'), 'relationship': FieldInfo(annotation=Union[str, NoneType], required=False, default=None, description="User's relationship to the team."), 'statsYear': FieldInfo(annotation=Union[str, int, NoneType], required=False, default=None, description='Statistics year.'), 'status': FieldInfo(annotation=Union[str, NoneType], required=False, default=None, description='Team status.'), 'teamId': FieldInfo(annotation=Union[str, int, NoneType], required=False, default=None, description='Team identifier.'), 'teamName': FieldInfo(annotation=Union[str, NoneType], required=False, default=None, description='Name of the team.')}ΒΆ
property model_fields_set: set[str]ΒΆ

Returns the set of fields that have been explicitly set on this model instance.

Returns:

A set of strings representing the fields that have been set,

i.e. that were not filled from defaults.

classmethod model_json_schema(by_alias=True, ref_template='#/$defs/{model}', schema_generator=<class 'pydantic.json_schema.GenerateJsonSchema'>, mode='validation', *, union_format='any_of')ΒΆ

Generates a JSON schema for a model class.

Parameters:
  • by_alias (bool) – Whether to use attribute aliases or not.

  • ref_template (str) – The reference template.

  • union_format (Literal['any_of', 'primitive_type_array']) –

    The format to use when combining schemas from unions together. Can be one of:

    keyword to combine schemas (the default). - β€˜primitive_type_array’: Use the [type](https://json-schema.org/understanding-json-schema/reference/type) keyword as an array of strings, containing each type of the combination. If any of the schemas is not a primitive type (string, boolean, null, integer or number) or contains constraints/metadata, falls back to any_of.

  • schema_generator (type[GenerateJsonSchema]) – To override the logic used to generate the JSON schema, as a subclass of GenerateJsonSchema with your desired modifications

  • mode (Literal['validation', 'serialization']) – The mode in which to generate the schema.

Returns:

The JSON schema for the given model class.

Return type:

dict[str, Any]

classmethod model_parametrized_name(params)ΒΆ

Compute the class name for parametrizations of generic classes.

This method can be overridden to achieve a custom naming scheme for generic BaseModels.

Parameters:

params (tuple[type[Any], ...]) – Tuple of types of the class. Given a generic class Model with 2 type variables and a concrete model Model[str, int], the value (str, int) would be passed to params.

Returns:

String representing the new class where params are passed to cls as type variables.

Raises:

TypeError – Raised when trying to generate concrete names for non-generic models.

Return type:

str

model_post_init(context, /)ΒΆ

Override this method to perform additional initialization after __init__ and model_construct. This is useful if you want to do some validation that requires the entire model to be initialized.

classmethod model_rebuild(*, force=False, raise_errors=True, _parent_namespace_depth=2, _types_namespace=None)ΒΆ

Try to rebuild the pydantic-core schema for the model.

This may be necessary when one of the annotations is a ForwardRef which could not be resolved during the initial attempt to build the schema, and automatic rebuilding fails.

Parameters:
  • force (bool) – Whether to force the rebuilding of the model schema, defaults to False.

  • raise_errors (bool) – Whether to raise errors, defaults to True.

  • _parent_namespace_depth (int) – The depth level of the parent namespace, defaults to 2.

  • _types_namespace (MappingNamespace | None) – The types namespace, defaults to None.

Returns:

Returns None if the schema is already β€œcomplete” and rebuilding was not required. If rebuilding _was_ required, returns True if rebuilding was successful, otherwise False.

Return type:

bool | None

classmethod model_validate(obj, *, strict=None, extra=None, from_attributes=None, context=None, by_alias=None, by_name=None)ΒΆ

Validate a pydantic model instance.

Parameters:
  • obj (Any) – The object to validate.

  • strict (bool | None) – Whether to enforce types strictly.

  • extra (Literal['allow', 'ignore', 'forbid'] | None) – Whether to ignore, allow, or forbid extra data during model validation. See the [extra configuration value][pydantic.ConfigDict.extra] for details.

  • from_attributes (bool | None) – Whether to extract data from object attributes.

  • context (Any | None) – Additional context to pass to the validator.

  • by_alias (bool | None) – Whether to use the field’s alias when validating against the provided input data.

  • by_name (bool | None) – Whether to use the field’s name when validating against the provided input data.

Raises:

ValidationError – If the object could not be validated.

Returns:

The validated model instance.

Return type:

Self

classmethod model_validate_json(json_data, *, strict=None, extra=None, context=None, by_alias=None, by_name=None)ΒΆ
!!! abstract β€œUsage Documentation”

[JSON Parsing](../concepts/json.md#json-parsing)

Validate the given JSON data against the Pydantic model.

Parameters:
  • json_data (str | bytes | bytearray) – The JSON data to validate.

  • strict (bool | None) – Whether to enforce types strictly.

  • extra (Literal['allow', 'ignore', 'forbid'] | None) – Whether to ignore, allow, or forbid extra data during model validation. See the [extra configuration value][pydantic.ConfigDict.extra] for details.

  • context (Any | None) – Extra variables to pass to the validator.

  • by_alias (bool | None) – Whether to use the field’s alias when validating against the provided input data.

  • by_name (bool | None) – Whether to use the field’s name when validating against the provided input data.

Returns:

The validated Pydantic model.

Raises:

ValidationError – If json_data is not a JSON string or the object could not be validated.

Return type:

Self

classmethod model_validate_strings(obj, *, strict=None, extra=None, context=None, by_alias=None, by_name=None)ΒΆ

Validate the given object with string data against the Pydantic model.

Parameters:
  • obj (Any) – The object containing string data to validate.

  • strict (bool | None) – Whether to enforce types strictly.

  • extra (Literal['allow', 'ignore', 'forbid'] | None) – Whether to ignore, allow, or forbid extra data during model validation. See the [extra configuration value][pydantic.ConfigDict.extra] for details.

  • context (Any | None) – Extra variables to pass to the validator.

  • by_alias (bool | None) – Whether to use the field’s alias when validating against the provided input data.

  • by_name (bool | None) – Whether to use the field’s name when validating against the provided input data.

Returns:

The validated Pydantic model.

Return type:

Self

classmethod parse_file(path, *, content_type=None, encoding='utf8', proto=None, allow_pickle=False)ΒΆ
Return type:

Self

classmethod parse_obj(obj)ΒΆ
Return type:

Self

classmethod parse_raw(b, *, content_type=None, encoding='utf8', proto=None, allow_pickle=False)ΒΆ
Return type:

Self

classmethod schema(by_alias=True, ref_template='#/$defs/{model}')ΒΆ
Return type:

Dict[str, Any]

classmethod schema_json(*, by_alias=True, ref_template='#/$defs/{model}', **dumps_kwargs)ΒΆ
Return type:

str

classmethod update_forward_refs(**localns)ΒΆ
classmethod validate(value)ΒΆ
Return type:

Self

class gamesheet_sdk.teams.TeamsAuthenticatedSession[source]ΒΆ

Bases: BaseAuthenticatedSession

Teams-pillar session that refreshes via the teams API gateway.

Delegates to refresh_access_token(), which POSTs to the teams gateway’s /api/auth/refresh endpoint.

Example:

from gamesheet_sdk.common.auth import (
    load_access_token,
    load_refresh_token,
    save_tokens,
)
from gamesheet_sdk.teams.session import TeamsAuthenticatedSession
from gamesheet_sdk.common.config import Config

config = Config(base_url="https://teams.gamesheet.app")
with TeamsAuthenticatedSession(
    config,
    access_token=load_access_token(config),
    refresh_token=load_refresh_token(config),
    on_refresh=lambda tokens: save_tokens(config, **tokens),
) as s:
    resp = s.get("/api/seasons/team/123")
    print(resp.json())

Initialize BaseAuthenticatedSession instance.

Parameters:
  • config (Config | None) – Optional SDK configuration.

  • access_token (str) – Access token.

  • refresh_token (str) – Refresh token.

  • on_refresh (OnRefreshCallback | None) – Optional callback invoked when tokens refresh.

__init__(config=None, *, access_token, refresh_token, on_refresh=None)ΒΆ

Initialize BaseAuthenticatedSession instance.

Parameters:
  • config (Config | None) – Optional SDK configuration.

  • access_token (str) – Access token.

  • refresh_token (str) – Refresh token.

  • on_refresh (OnRefreshCallback | None) – Optional callback invoked when tokens refresh.

close()ΒΆ

Persist cookies and release the underlying HTTP connection pool.

property cookies: RequestsCookieJarΒΆ

Underlying cookie jar.

Mutating this affects subsequent requests.

Returns:

RequestsCookieJar – Return value.

delete(url, **kwargs)ΒΆ

Send a DELETE request.

See request().

Parameters:
  • url (str) – Absolute URL, or a path relative to Config.base_url.

  • **kwargs (Any) – Additional keyword arguments forwarded to request().

Returns:

requests.Response – The HTTP response from the server.

Return type:

Response

get(url, **kwargs)ΒΆ

Send a GET request.

See request().

Parameters:
  • url (str) – Absolute URL, or a path relative to Config.base_url.

  • **kwargs (Any) – Additional keyword arguments forwarded to request().

Returns:

requests.Response – The HTTP response from the server.

Return type:

Response

property headers: MutableMapping[str, str | bytes]ΒΆ

Default headers attached to every request from this session.

The underlying mapping is a case-insensitive dict (as supplied by requests.Session), but the declared return type matches the stub for requests.Session.headers.

Returns:

MutableMapping[str, str | bytes] – Return value.

patch(url, **kwargs)ΒΆ

Send a PATCH request.

See request().

Parameters:
  • url (str) – Absolute URL, or a path relative to Config.base_url.

  • **kwargs (Any) – Additional keyword arguments forwarded to request().

Returns:

requests.Response – The HTTP response from the server.

Return type:

Response

post(url, **kwargs)ΒΆ

Send a POST request.

See request().

Parameters:
  • url (str) – Absolute URL, or a path relative to Config.base_url.

  • **kwargs (Any) – Additional keyword arguments forwarded to request().

Returns:

requests.Response – The HTTP response from the server.

Return type:

Response

put(url, **kwargs)ΒΆ

Send a PUT request.

See request().

Parameters:
  • url (str) – Absolute URL, or a path relative to Config.base_url.

  • **kwargs (Any) – Additional keyword arguments forwarded to request().

Returns:

requests.Response – The HTTP response from the server.

Return type:

Response

request(method, url, *, timeout=None, **kwargs)ΒΆ

Send a request, refreshing the bearer and retrying once on 401 or 403.

Parameters:
  • method (str) – HTTP method (GET, POST, PUT, DELETE, etc.).

  • url (str) – Target URL for the request.

  • timeout (float | None) – Request timeout in seconds. If None, uses the timeout from config.

  • **kwargs (Any) – Additional keyword arguments forwarded to the parent request().

Returns:

requests.Response –

HTTP response object from the request. If token refresh fails, returns the

original 401/403 response without raising an exception.

Return type:

requests.Response

save()ΒΆ

Persist the current cookie state to Config.session_path.

The on-disk format preserves the full cookie attribute set (domain, path, secure, expires) so that reloaded cookies are sent against the correct scopes.

set_bearer_token(token)ΒΆ

Attach Authorization: Bearer <token> to all subsequent requests.

Convenience for s.headers["Authorization"] = f"Bearer {token}".

Parameters:

token (str) – The bearer token to attach

class gamesheet_sdk.teams.TeamsLoginFlow[source]ΒΆ

Bases: object

HTTP-based LoginFlow for the teams dashboard.

Authenticates via two sequential HTTP calls β€” Firebase REST signInWithPassword followed by a token exchange against the teams API gateway β€” without requiring a headless browser.

Example

Authenticating with the teams dashboard:

from gamesheet_sdk.common.config import Config
from gamesheet_sdk.teams.login import TeamsLoginFlow

config = Config(base_url="https://teams.gamesheet.app")
flow = TeamsLoginFlow(config)
tokens = flow.authenticate(email="user@example.com", password="secret")
print(tokens["access"])
Parameters:

config (Config) – SDK configuration (credentials, URLs, storage paths).

Initialize TeamsLoginFlow with SDK config.

Parameters:

config (Config) – SDK configuration (credentials, URLs, storage paths).

__init__(config)[source]ΒΆ

Initialize TeamsLoginFlow with SDK config.

Parameters:

config (Config) – SDK configuration (credentials, URLs, storage paths).

authenticate(email=None, password=None, *, timeout=None)[source]ΒΆ

Run the HTTP-only teams login and return tokens.

Resolves credentials from the arguments or Config, authenticates with Firebase, exchanges the ID token for application tokens, and persists them to disk.

Parameters:
  • email (str | None) – Login email, or None to resolve from config/env.

  • password (str | None) – Login password, or None to resolve from config/env.

  • timeout (float | None) – HTTP request timeout in seconds, or None for the default.

Returns:

dict[str, str] – Token bundle with "access" and "refresh" keys.

Return type:

dict[str, str]

class gamesheet_sdk.teams.UpdatedGameResult[source]ΒΆ

Bases: BaseModel

Result of updating a scheduled game.

successΒΆ

Whether the game update succeeded.

Type:

bool

idΒΆ

Game identifier.

Type:

int | str | None

messageΒΆ

Status message.

Type:

str

game_numberΒΆ

Game number.

Type:

str | None

date_timeΒΆ

Start date and time.

Type:

str | None

end_timeΒΆ

End time.

Type:

str | None

game_typeΒΆ

Game type.

Type:

str | None

locationΒΆ

Game location or venue.

Type:

str | None

team_idΒΆ

Team identifier.

Type:

int | str | None

opposing_team_idΒΆ

Opposing team identifier.

Type:

int | str | None

season_idΒΆ

Season identifier.

Type:

int | str | None

association_idΒΆ

Association identifier.

Type:

int | str | None

league_idΒΆ

League identifier.

Type:

int | str | None

division_idΒΆ

Division identifier.

Type:

int | str | None

opposing_divisionΒΆ

Opposing division identifier.

Type:

int | str | None

home_flagΒΆ

Home team flag.

Type:

bool | None

time_zone_nameΒΆ

IANA time zone name.

Type:

str | None

time_zone_offsetΒΆ

Time zone offset in minutes.

Type:

int | None

scorekeeper_nameΒΆ

Scorekeeper name.

Type:

str | None

scorekeeper_phoneΒΆ

Scorekeeper phone.

Type:

str | None

broadcast_providerΒΆ

Broadcast provider.

Type:

str | None

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

model_config = {'extra': 'allow'}ΒΆ

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

success: boolΒΆ
id: int | str | NoneΒΆ
message: strΒΆ
game_number: str | NoneΒΆ
date_time: str | NoneΒΆ
end_time: str | NoneΒΆ
game_type: str | NoneΒΆ
location: str | NoneΒΆ
team_id: int | str | NoneΒΆ
opposing_team_id: int | str | NoneΒΆ
season_id: int | str | NoneΒΆ
association_id: int | str | NoneΒΆ
league_id: int | str | NoneΒΆ
division_id: int | str | NoneΒΆ
opposing_division: int | str | NoneΒΆ
home_flag: bool | NoneΒΆ
time_zone_name: str | NoneΒΆ
time_zone_offset: int | NoneΒΆ
scorekeeper_name: str | NoneΒΆ
scorekeeper_phone: str | NoneΒΆ
broadcast_provider: str | NoneΒΆ
__init__(**data)ΒΆ

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

classmethod construct(_fields_set=None, **values)ΒΆ
Return type:

Self

copy(*, include=None, exclude=None, update=None, deep=False)ΒΆ

Returns a copy of the model.

!!! warning β€œDeprecated”

This method is now deprecated; use model_copy instead.

If you need include or exclude, use:

`python {test="skip" lint="skip"} data = self.model_dump(include=include, exclude=exclude, round_trip=True) data = {**data, **(update or {})} copied = self.model_validate(data) `

Parameters:
  • include (AbstractSetIntStr | MappingIntStrAny | None) – Optional set or mapping specifying which fields to include in the copied model.

  • exclude (AbstractSetIntStr | MappingIntStrAny | None) – Optional set or mapping specifying which fields to exclude in the copied model.

  • update (Dict[str, Any] | None) – Optional dictionary of field-value pairs to override field values in the copied model.

  • deep (bool) – If True, the values of fields that are Pydantic models will be deep-copied.

Returns:

A copy of the model with included, excluded and updated fields as specified.

Return type:

Self

dict(*, include=None, exclude=None, by_alias=False, exclude_unset=False, exclude_defaults=False, exclude_none=False)ΒΆ
Return type:

Dict[str, Any]

classmethod from_orm(obj)ΒΆ
Return type:

Self

json(*, include=None, exclude=None, by_alias=False, exclude_unset=False, exclude_defaults=False, exclude_none=False, encoder=PydanticUndefined, models_as_dict=PydanticUndefined, **dumps_kwargs)ΒΆ
Return type:

str

model_computed_fields = {}ΒΆ
classmethod model_construct(_fields_set=None, **values)ΒΆ

Creates a new instance of the Model class with validated data.

Creates a new model setting __dict__ and __pydantic_fields_set__ from trusted or pre-validated data. Default values are respected, but no other validation is performed.

!!! note

model_construct() generally respects the model_config.extra setting on the provided model. That is, if model_config.extra == β€˜allow’, then all extra passed values are added to the model instance’s __dict__ and __pydantic_extra__ fields. If model_config.extra == β€˜ignore’ (the default), then all extra passed values are ignored. Because no validation is performed with a call to model_construct(), having model_config.extra == β€˜forbid’ does not result in an error if extra values are passed, but they will be ignored.

Parameters:
  • _fields_set (set[str] | None) – A set of field names that were originally explicitly set during instantiation. If provided, this is directly used for the [model_fields_set][pydantic.BaseModel.model_fields_set] attribute. Otherwise, the field names from the values argument will be used.

  • values (Any) – Trusted or pre-validated data dictionary.

Returns:

A new instance of the Model class with validated data.

Return type:

Self

model_copy(*, update=None, deep=False)ΒΆ
!!! abstract β€œUsage Documentation”

[model_copy](../concepts/models.md#model-copy)

Returns a copy of the model.

!!! note

The underlying instance’s [__dict__][object.__dict__] attribute is copied. This might have unexpected side effects if you store anything in it, on top of the model fields (e.g. the value of [cached properties][functools.cached_property]).

Parameters:
  • update (Mapping[str, Any] | None) – Values to change/add in the new model. Note: the data is not validated before creating the new model. You should trust this data.

  • deep (bool) – Set to True to make a deep copy of the model.

Returns:

New model instance.

Return type:

Self

model_dump(*, mode='python', include=None, exclude=None, context=None, by_alias=None, exclude_unset=False, exclude_defaults=False, exclude_none=False, exclude_computed_fields=False, round_trip=False, warnings=True, fallback=None, serialize_as_any=False, polymorphic_serialization=None)ΒΆ
!!! abstract β€œUsage Documentation”

[model_dump](../concepts/serialization.md#python-mode)

Generate a dictionary representation of the model, optionally specifying which fields to include or exclude.

Parameters:
  • mode (Literal['json', 'python'] | str) – The mode in which to_python should run. If mode is β€˜json’, the output will only contain JSON serializable types. If mode is β€˜python’, the output may contain non-JSON-serializable Python objects.

  • include (set[int] | set[str] | Mapping[int, set[int] | set[str] | Mapping[int, IncEx | bool] | Mapping[str, IncEx | bool] | bool] | Mapping[str, set[int] | set[str] | Mapping[int, IncEx | bool] | Mapping[str, IncEx | bool] | bool] | None) – A set of fields to include in the output.

  • exclude (set[int] | set[str] | Mapping[int, set[int] | set[str] | Mapping[int, IncEx | bool] | Mapping[str, IncEx | bool] | bool] | Mapping[str, set[int] | set[str] | Mapping[int, IncEx | bool] | Mapping[str, IncEx | bool] | bool] | None) – A set of fields to exclude from the output.

  • context (Any | None) – Additional context to pass to the serializer.

  • by_alias (bool | None) – Whether to use the field’s alias in the dictionary key if defined.

  • exclude_unset (bool) – Whether to exclude fields that have not been explicitly set.

  • exclude_defaults (bool) – Whether to exclude fields that are set to their default value.

  • exclude_none (bool) – Whether to exclude fields that have a value of None.

  • exclude_computed_fields (bool) – Whether to exclude computed fields. While this can be useful for round-tripping, it is usually recommended to use the dedicated round_trip parameter instead.

  • round_trip (bool) – If True, dumped values should be valid as input for non-idempotent types such as Json[T].

  • warnings (bool | Literal['none', 'warn', 'error']) – How to handle serialization errors. False/”none” ignores them, True/”warn” logs errors, β€œerror” raises a [PydanticSerializationError][pydantic_core.PydanticSerializationError].

  • fallback (Callable[[Any], Any] | None) – A function to call when an unknown value is encountered. If not provided, a [PydanticSerializationError][pydantic_core.PydanticSerializationError] error is raised.

  • serialize_as_any (bool) – Whether to serialize fields with duck-typing serialization behavior.

  • polymorphic_serialization (bool | None) – Whether to use model and dataclass polymorphic serialization for this call.

Returns:

A dictionary representation of the model.

Return type:

dict[str, Any]

model_dump_json(*, indent=None, ensure_ascii=False, include=None, exclude=None, context=None, by_alias=None, exclude_unset=False, exclude_defaults=False, exclude_none=False, exclude_computed_fields=False, round_trip=False, warnings=True, fallback=None, serialize_as_any=False, polymorphic_serialization=None)ΒΆ
!!! abstract β€œUsage Documentation”

[model_dump_json](../concepts/serialization.md#json-mode)

Generates a JSON representation of the model using Pydantic’s to_json method.

Parameters:
  • indent (int | None) – Indentation to use in the JSON output. If None is passed, the output will be compact.

  • ensure_ascii (bool) – If True, the output is guaranteed to have all incoming non-ASCII characters escaped. If False (the default), these characters will be output as-is.

  • include (set[int] | set[str] | Mapping[int, set[int] | set[str] | Mapping[int, IncEx | bool] | Mapping[str, IncEx | bool] | bool] | Mapping[str, set[int] | set[str] | Mapping[int, IncEx | bool] | Mapping[str, IncEx | bool] | bool] | None) – Field(s) to include in the JSON output.

  • exclude (set[int] | set[str] | Mapping[int, set[int] | set[str] | Mapping[int, IncEx | bool] | Mapping[str, IncEx | bool] | bool] | Mapping[str, set[int] | set[str] | Mapping[int, IncEx | bool] | Mapping[str, IncEx | bool] | bool] | None) – Field(s) to exclude from the JSON output.

  • context (Any | None) – Additional context to pass to the serializer.

  • by_alias (bool | None) – Whether to serialize using field aliases.

  • exclude_unset (bool) – Whether to exclude fields that have not been explicitly set.

  • exclude_defaults (bool) – Whether to exclude fields that are set to their default value.

  • exclude_none (bool) – Whether to exclude fields that have a value of None.

  • exclude_computed_fields (bool) – Whether to exclude computed fields. While this can be useful for round-tripping, it is usually recommended to use the dedicated round_trip parameter instead.

  • round_trip (bool) – If True, dumped values should be valid as input for non-idempotent types such as Json[T].

  • warnings (bool | Literal['none', 'warn', 'error']) – How to handle serialization errors. False/”none” ignores them, True/”warn” logs errors, β€œerror” raises a [PydanticSerializationError][pydantic_core.PydanticSerializationError].

  • fallback (Callable[[Any], Any] | None) – A function to call when an unknown value is encountered. If not provided, a [PydanticSerializationError][pydantic_core.PydanticSerializationError] error is raised.

  • serialize_as_any (bool) – Whether to serialize fields with duck-typing serialization behavior.

  • polymorphic_serialization (bool | None) – Whether to use model and dataclass polymorphic serialization for this call.

Returns:

A JSON string representation of the model.

Return type:

str

property model_extra: dict[str, Any] | NoneΒΆ

Get extra fields set during validation.

Returns:

A dictionary of extra fields, or None if config.extra is not set to β€œallow”.

model_fields = {'association_id': FieldInfo(annotation=Union[int, str, NoneType], required=False, default=None, description='Association identifier.'), 'broadcast_provider': FieldInfo(annotation=Union[str, NoneType], required=False, default=None, description='Broadcast provider.'), 'date_time': FieldInfo(annotation=Union[str, NoneType], required=False, default=None, description='Start date and time.'), 'division_id': FieldInfo(annotation=Union[int, str, NoneType], required=False, default=None, description='Division identifier.'), 'end_time': FieldInfo(annotation=Union[str, NoneType], required=False, default=None, description='End time.'), 'game_number': FieldInfo(annotation=Union[str, NoneType], required=False, default=None, description='Game number.'), 'game_type': FieldInfo(annotation=Union[str, NoneType], required=False, default=None, description='Game type.'), 'home_flag': FieldInfo(annotation=Union[bool, NoneType], required=False, default=None, description='Home team flag.'), 'id': FieldInfo(annotation=Union[int, str, NoneType], required=False, default=None, description='Game identifier.'), 'league_id': FieldInfo(annotation=Union[int, str, NoneType], required=False, default=None, description='League identifier.'), 'location': FieldInfo(annotation=Union[str, NoneType], required=False, default=None, description='Game location or venue.'), 'message': FieldInfo(annotation=str, required=False, default='Game updated successfully', description='Status message.'), 'opposing_division': FieldInfo(annotation=Union[int, str, NoneType], required=False, default=None, description='Opposing division identifier.'), 'opposing_team_id': FieldInfo(annotation=Union[int, str, NoneType], required=False, default=None, description='Opposing team identifier.'), 'scorekeeper_name': FieldInfo(annotation=Union[str, NoneType], required=False, default=None, description='Scorekeeper name.'), 'scorekeeper_phone': FieldInfo(annotation=Union[str, NoneType], required=False, default=None, description='Scorekeeper phone.'), 'season_id': FieldInfo(annotation=Union[int, str, NoneType], required=False, default=None, description='Season identifier.'), 'success': FieldInfo(annotation=bool, required=False, default=True, description='Whether the operation succeeded.'), 'team_id': FieldInfo(annotation=Union[int, str, NoneType], required=False, default=None, description='Team identifier.'), 'time_zone_name': FieldInfo(annotation=Union[str, NoneType], required=False, default=None, description='Time zone name.'), 'time_zone_offset': FieldInfo(annotation=Union[int, NoneType], required=False, default=None, description='Time zone offset in minutes.')}ΒΆ
property model_fields_set: set[str]ΒΆ

Returns the set of fields that have been explicitly set on this model instance.

Returns:

A set of strings representing the fields that have been set,

i.e. that were not filled from defaults.

classmethod model_json_schema(by_alias=True, ref_template='#/$defs/{model}', schema_generator=<class 'pydantic.json_schema.GenerateJsonSchema'>, mode='validation', *, union_format='any_of')ΒΆ

Generates a JSON schema for a model class.

Parameters:
  • by_alias (bool) – Whether to use attribute aliases or not.

  • ref_template (str) – The reference template.

  • union_format (Literal['any_of', 'primitive_type_array']) –

    The format to use when combining schemas from unions together. Can be one of:

    keyword to combine schemas (the default). - β€˜primitive_type_array’: Use the [type](https://json-schema.org/understanding-json-schema/reference/type) keyword as an array of strings, containing each type of the combination. If any of the schemas is not a primitive type (string, boolean, null, integer or number) or contains constraints/metadata, falls back to any_of.

  • schema_generator (type[GenerateJsonSchema]) – To override the logic used to generate the JSON schema, as a subclass of GenerateJsonSchema with your desired modifications

  • mode (Literal['validation', 'serialization']) – The mode in which to generate the schema.

Returns:

The JSON schema for the given model class.

Return type:

dict[str, Any]

classmethod model_parametrized_name(params)ΒΆ

Compute the class name for parametrizations of generic classes.

This method can be overridden to achieve a custom naming scheme for generic BaseModels.

Parameters:

params (tuple[type[Any], ...]) – Tuple of types of the class. Given a generic class Model with 2 type variables and a concrete model Model[str, int], the value (str, int) would be passed to params.

Returns:

String representing the new class where params are passed to cls as type variables.

Raises:

TypeError – Raised when trying to generate concrete names for non-generic models.

Return type:

str

model_post_init(context, /)ΒΆ

Override this method to perform additional initialization after __init__ and model_construct. This is useful if you want to do some validation that requires the entire model to be initialized.

classmethod model_rebuild(*, force=False, raise_errors=True, _parent_namespace_depth=2, _types_namespace=None)ΒΆ

Try to rebuild the pydantic-core schema for the model.

This may be necessary when one of the annotations is a ForwardRef which could not be resolved during the initial attempt to build the schema, and automatic rebuilding fails.

Parameters:
  • force (bool) – Whether to force the rebuilding of the model schema, defaults to False.

  • raise_errors (bool) – Whether to raise errors, defaults to True.

  • _parent_namespace_depth (int) – The depth level of the parent namespace, defaults to 2.

  • _types_namespace (MappingNamespace | None) – The types namespace, defaults to None.

Returns:

Returns None if the schema is already β€œcomplete” and rebuilding was not required. If rebuilding _was_ required, returns True if rebuilding was successful, otherwise False.

Return type:

bool | None

classmethod model_validate(obj, *, strict=None, extra=None, from_attributes=None, context=None, by_alias=None, by_name=None)ΒΆ

Validate a pydantic model instance.

Parameters:
  • obj (Any) – The object to validate.

  • strict (bool | None) – Whether to enforce types strictly.

  • extra (Literal['allow', 'ignore', 'forbid'] | None) – Whether to ignore, allow, or forbid extra data during model validation. See the [extra configuration value][pydantic.ConfigDict.extra] for details.

  • from_attributes (bool | None) – Whether to extract data from object attributes.

  • context (Any | None) – Additional context to pass to the validator.

  • by_alias (bool | None) – Whether to use the field’s alias when validating against the provided input data.

  • by_name (bool | None) – Whether to use the field’s name when validating against the provided input data.

Raises:

ValidationError – If the object could not be validated.

Returns:

The validated model instance.

Return type:

Self

classmethod model_validate_json(json_data, *, strict=None, extra=None, context=None, by_alias=None, by_name=None)ΒΆ
!!! abstract β€œUsage Documentation”

[JSON Parsing](../concepts/json.md#json-parsing)

Validate the given JSON data against the Pydantic model.

Parameters:
  • json_data (str | bytes | bytearray) – The JSON data to validate.

  • strict (bool | None) – Whether to enforce types strictly.

  • extra (Literal['allow', 'ignore', 'forbid'] | None) – Whether to ignore, allow, or forbid extra data during model validation. See the [extra configuration value][pydantic.ConfigDict.extra] for details.

  • context (Any | None) – Extra variables to pass to the validator.

  • by_alias (bool | None) – Whether to use the field’s alias when validating against the provided input data.

  • by_name (bool | None) – Whether to use the field’s name when validating against the provided input data.

Returns:

The validated Pydantic model.

Raises:

ValidationError – If json_data is not a JSON string or the object could not be validated.

Return type:

Self

classmethod model_validate_strings(obj, *, strict=None, extra=None, context=None, by_alias=None, by_name=None)ΒΆ

Validate the given object with string data against the Pydantic model.

Parameters:
  • obj (Any) – The object containing string data to validate.

  • strict (bool | None) – Whether to enforce types strictly.

  • extra (Literal['allow', 'ignore', 'forbid'] | None) – Whether to ignore, allow, or forbid extra data during model validation. See the [extra configuration value][pydantic.ConfigDict.extra] for details.

  • context (Any | None) – Extra variables to pass to the validator.

  • by_alias (bool | None) – Whether to use the field’s alias when validating against the provided input data.

  • by_name (bool | None) – Whether to use the field’s name when validating against the provided input data.

Returns:

The validated Pydantic model.

Return type:

Self

classmethod parse_file(path, *, content_type=None, encoding='utf8', proto=None, allow_pickle=False)ΒΆ
Return type:

Self

classmethod parse_obj(obj)ΒΆ
Return type:

Self

classmethod parse_raw(b, *, content_type=None, encoding='utf8', proto=None, allow_pickle=False)ΒΆ
Return type:

Self

classmethod schema(by_alias=True, ref_template='#/$defs/{model}')ΒΆ
Return type:

Dict[str, Any]

classmethod schema_json(*, by_alias=True, ref_template='#/$defs/{model}', **dumps_kwargs)ΒΆ
Return type:

str

classmethod update_forward_refs(**localns)ΒΆ
classmethod validate(value)ΒΆ
Return type:

Self

gamesheet_sdk.teams.archive_team(session, team_id, *, timeout=15.0)[source]ΒΆ

Archive a team to remove it from active lists while preserving data.

Parameters:
  • session (BaseAuthenticatedSession) – Authenticated HTTP session.

  • team_id (str | int) – Identifier of the team to archive.

  • timeout (float) – Request timeout in seconds.

Returns:

TeamDetail – TeamDetail representing the archived team.

Return type:

TeamDetail

gamesheet_sdk.teams.build_rrule(frequency, *, interval=1, by_day=None, until=None)[source]ΒΆ

Build an RRULE string for recurring events.

Parameters:
  • frequency (str | None) – Recurrence frequency (β€˜daily’, β€˜weekly’, β€˜monthly’).

  • interval (int) – Recurrence interval in units of frequency (default: 1).

  • by_day (str | list[str] | None) – Days of week for weekly recurrence (e.g., β€˜TU,TH’, β€˜mon,wed’).

  • until (str | None) – Recurrence end date (e.g. β€˜2026-11-28’ or β€˜20261128T235959Z’, default: None).

Returns:

str | None – Formatted RRULE string or None if frequency is not specified.

Raises:

GameSheetError – If frequency is not recognized.

Return type:

str | None

gamesheet_sdk.teams.create_calendar_event_raw(session, payload, *, timeout=15.0)[source]ΒΆ

Create a calendar event or practice via POST /api/calendar/events.

Parameters:
  • session (BaseAuthenticatedSession) – Authenticated session instance.

  • payload (dict[str, Any]) – Event creation payload.

  • timeout (float) – Request timeout in seconds.

Returns:

dict[str, Any] – Parsed JSON response from the API.

Raises:
Return type:

dict[str, Any]

gamesheet_sdk.teams.create_event(session, team_id, title, start_date_time, end_time, *, event_type='event', timezone=None, location='', notes='', all_day=False, rrule=None, repeat_until=None, timeout=15.0)[source]ΒΆ

Create a calendar event (β€˜event’ or β€˜practice’ type).

Parameters:
  • session (BaseAuthenticatedSession) – Authenticated session instance.

  • team_id (str | int) – Team identifier (prototeam ID or team ID).

  • title (str) – Event title.

  • start_date_time (str) – Start date/time (e.g. β€˜2026-08-21T13:30’).

  • end_time (str) – End time (e.g. β€˜14:30’).

  • event_type (str) – Event type (β€˜event’ or β€˜practice’, default: β€˜event’).

  • timezone (str | None) – Timezone name (defaults to local timezone).

  • location (str) – Venue or location address (default: empty string).

  • notes (str) – Event notes or description (default: empty string).

  • all_day (bool) – Whether event is all day (default: False).

  • rrule (str | None) – Recurrence rule (default: None).

  • repeat_until (str | None) – Recurrence end date (e.g. β€˜2027-03-22’, default: None).

  • timeout (float) – Request timeout in seconds.

Returns:

CalendarEventCreated – Created event details model.

Raises:

GameSheetError – If the server returns malformed data.

Return type:

CalendarEventCreated

gamesheet_sdk.teams.create_game(session, team_id, season_id, division_id, opposing_team_id, date_time, end_time, *, home_flag=True, opposing_division=None, association_id=0, league_id=0, game_number='', game_type='regular_season', location='', scorekeeper_name='', scorekeeper_phone='', broadcast_provider='', time_zone_name=None, time_zone_offset=None, timeout=15.0)[source]ΒΆ

Create a scheduled game via the teams schedule-game endpoint.

Parameters:
  • session (BaseAuthenticatedSession) – Authenticated session instance.

  • team_id (int | str) – Team identifier.

  • season_id (int | str) – Season identifier.

  • division_id (int | str) – Division identifier.

  • opposing_team_id (int | str) – Opposing team identifier.

  • date_time (str) – Start date/time (e.g. β€˜2026-08-20T12:00’).

  • end_time (str) – End time (e.g. β€˜13:15’).

  • home_flag (bool) – Whether the team is the home team (default: True).

  • opposing_division (int | str | None) – Opposing team division (default: same as division_id).

  • association_id (int | str) – Parent association identifier (default: 0).

  • league_id (int | str) – Parent league identifier (default: 0).

  • game_number (str) – Game number / identifier (default: β€˜β€™).

  • game_type (str) – Game type (default: β€˜regular_season’). Must be a valid game type.

  • location (str) – Game venue / location (default: β€˜β€™).

  • scorekeeper_name (str) – Scorekeeper full name (default: β€˜β€™).

  • scorekeeper_phone (str) – Scorekeeper phone number (default: β€˜β€™).

  • broadcast_provider (str) – Broadcast provider key (default: β€˜β€™).

  • time_zone_name (str | None) – IANA time zone name (defaults to local timezone).

  • time_zone_offset (int | None) – Time zone offset in minutes (defaults to local offset).

  • timeout (float) – Request timeout in seconds.

Returns:

CreatedGameResult – Result containing game creation details and status.

Return type:

CreatedGameResult

gamesheet_sdk.teams.create_practice(session, team_id, start_date_time, end_time, *, title='Practice', timezone=None, location='', notes='', all_day=False, rrule=None, repeat_until=None, timeout=15.0)[source]ΒΆ

Create a practice calendar event (β€˜practice’ type).

Parameters:
  • session (BaseAuthenticatedSession) – Authenticated session instance.

  • team_id (str | int) – Team identifier (prototeam ID or team ID).

  • start_date_time (str) – Start date/time (e.g. β€˜2026-08-30T13:30’).

  • end_time (str) – End time (e.g. β€˜14:30’).

  • title (str) – Practice title (default: β€˜Practice’).

  • timezone (str | None) – Timezone name (defaults to local timezone).

  • location (str) – Venue or location address (default: empty string).

  • notes (str) – Notes or description (default: empty string).

  • all_day (bool) – Whether practice is all day (default: False).

  • rrule (str | None) – Recurrence rule (default: None).

  • repeat_until (str | None) – Recurrence end date (default: None).

  • timeout (float) – Request timeout in seconds.

Returns:

CalendarEventCreated – Created practice details model.

Return type:

CalendarEventCreated

gamesheet_sdk.teams.create_schedule_game_raw(session, payload, *, timeout=15.0)[source]ΒΆ

Create a scheduled game via POST /api/schedule-game.

Parameters:
  • session (BaseAuthenticatedSession) – Authenticated session instance.

  • payload (dict[str, Any]) – Game creation payload.

  • timeout (float) – Request timeout in seconds.

Returns:

dict[str, Any] – Parsed JSON response from the API.

Raises:
Return type:

dict[str, Any]

gamesheet_sdk.teams.delete_calendar_event(session, event_id, *, timeout=15.0)[source]ΒΆ

Delete a calendar event and all of its occurrences.

Parameters:
  • session (BaseAuthenticatedSession) – Authenticated session instance.

  • event_id (str) – Identifier of the calendar event series.

  • timeout (float) – Request timeout in seconds.

Returns:

ScheduleDeleteResult – Result of deletion containing success flag and message.

Return type:

ScheduleDeleteResult

gamesheet_sdk.teams.delete_calendar_event_raw(session, event_id, *, timeout=15.0)[source]ΒΆ

Execute raw HTTP DELETE request to delete a calendar event series.

Parameters:
  • session (BaseAuthenticatedSession) – Authenticated session instance.

  • event_id (str) – ID of the calendar event series to delete.

  • timeout (float) – Request timeout in seconds.

Returns:

dict[str, Any] – Parsed JSON response from the API.

Raises:
Return type:

dict[str, Any]

gamesheet_sdk.teams.delete_calendar_occurrence(session, occurrence_id, *, delete_future=False, timeout=15.0)[source]ΒΆ

Delete a calendar occurrence (optionally including all future occurrences).

Parameters:
  • session (BaseAuthenticatedSession) – Authenticated session instance.

  • occurrence_id (str) – Identifier of the occurrence.

  • delete_future (bool) – If True, delete this and all future occurrences.

  • timeout (float) – Request timeout in seconds.

Returns:

ScheduleDeleteResult – Result of deletion containing success flag and message.

Return type:

ScheduleDeleteResult

gamesheet_sdk.teams.delete_calendar_occurrence_raw(session, occurrence_id, *, delete_future=False, timeout=15.0)[source]ΒΆ

Execute raw HTTP DELETE request to delete a calendar occurrence.

Parameters:
  • session (BaseAuthenticatedSession) – Authenticated session instance.

  • occurrence_id (str) – ID of the calendar occurrence to delete.

  • delete_future (bool) – Whether to delete this and all future occurrences.

  • timeout (float) – Request timeout in seconds.

Returns:

dict[str, Any] – Parsed JSON response from the API.

Raises:
Return type:

dict[str, Any]

gamesheet_sdk.teams.delete_event(session, event_id, *, delete_future=False, all_occurrences=False, timeout=15.0)[source]ΒΆ

Delete a calendar event series or occurrence.

Parameters:
  • session (BaseAuthenticatedSession) – Authenticated session instance.

  • event_id (str) – Identifier of the calendar event or occurrence.

  • delete_future (bool) – If True, delete this and all future occurrences.

  • all_occurrences (bool) – If True, delete the entire event series via /api/calendar/events.

  • timeout (float) – Request timeout in seconds.

Returns:

ScheduleDeleteResult – Result of deletion containing success flag and message.

Return type:

ScheduleDeleteResult

gamesheet_sdk.teams.delete_game(session, game_id, *, timeout=15.0)[source]ΒΆ

Delete a scheduled game.

Parameters:
  • session (BaseAuthenticatedSession) – Authenticated session instance.

  • game_id (str | int) – Identifier of the scheduled game.

  • timeout (float) – Request timeout in seconds.

Returns:

ScheduleDeleteResult – Result of deletion containing success flag and message.

Return type:

ScheduleDeleteResult

gamesheet_sdk.teams.delete_practice(session, practice_id, *, delete_future=False, all_occurrences=False, timeout=15.0)[source]ΒΆ

Delete a practice calendar event series or occurrence.

Parameters:
  • session (BaseAuthenticatedSession) – Authenticated session instance.

  • practice_id (str) – Identifier of the practice event or occurrence.

  • delete_future (bool) – If True, delete this and all future occurrences.

  • all_occurrences (bool) – If True, delete the entire practice series via /api/calendar/events.

  • timeout (float) – Request timeout in seconds.

Returns:

ScheduleDeleteResult – Result of deletion containing success flag and message.

Return type:

ScheduleDeleteResult

gamesheet_sdk.teams.delete_schedule_game_raw(session, game_id, *, timeout=15.0)[source]ΒΆ

Execute raw HTTP DELETE request to delete a scheduled game via DELETE /api/schedule-game/{game_id}.

Parameters:
  • session (BaseAuthenticatedSession) – Authenticated session instance.

  • game_id (str | int) – ID of the scheduled game to delete.

  • timeout (float) – Request timeout in seconds.

Returns:

dict[str, Any] – Parsed JSON response from the API.

Raises:
Return type:

dict[str, Any]

gamesheet_sdk.teams.delete_team(session, team_id, *, timeout=15.0)[source]ΒΆ

Delete a team.

Parameters:
  • session (BaseAuthenticatedSession) – Authenticated HTTP session.

  • team_id (str | int) – Identifier of the team to delete.

  • timeout (float) – Request timeout in seconds.

Raises:
gamesheet_sdk.teams.fetch_availability_raw(session, team_id, event_id, event_type, *, timeout=15.0)[source]ΒΆ

Fetch batch availability data for a team event.

Parameters:
  • session (BaseAuthenticatedSession) – Authenticated session instance.

  • team_id (str | int) – Team identifier (prototeam ID).

  • event_id (str | int) – Event identifier.

  • event_type (str) – Type of event (e.g., β€˜event’, β€˜game’, β€˜practice’).

  • timeout (float) – Request timeout in seconds.

Returns:

dict[str, Any] – Parsed JSON response from the availability API.

Raises:
Return type:

dict[str, Any]

gamesheet_sdk.teams.fetch_calendar_raw(session, team_id, *, month='all', timeout=15.0)[source]ΒΆ

Fetch raw calendar data from the teams API for a specified team.

Parameters:
  • session (BaseAuthenticatedSession) – Authenticated session instance.

  • team_id (str) – Team identifier.

  • month (str) – Month filter for calendar events (default: β€˜all’).

  • timeout (float) – Request timeout in seconds.

Returns:

dict[str, Any] – Parsed JSON response from the calendar API.

Raises:
Return type:

dict[str, Any]

gamesheet_sdk.teams.fetch_event_occurrence_raw(session, event_id, *, timeout=15.0)[source]ΒΆ

Fetch raw calendar event occurrence data from the teams API.

Parameters:
  • session (BaseAuthenticatedSession) – Authenticated session instance.

  • event_id (str | int) – Identifier of the event occurrence.

  • timeout (float) – Request timeout in seconds.

Returns:

dict[str, Any] – Parsed JSON response from the calendar occurrences API.

Raises:
Return type:

dict[str, Any]

gamesheet_sdk.teams.fetch_scheduled_game_raw(session, game_id, *, timeout=15.0)[source]ΒΆ

Fetch raw game details from the teams schedule-game API.

Parameters:
  • session (BaseAuthenticatedSession) – Authenticated session instance.

  • game_id (str | int) – Identifier of the scheduled game.

  • timeout (float) – Request timeout in seconds.

Returns:

dict[str, Any] – Parsed JSON response from the schedule-game API.

Raises:
Return type:

dict[str, Any]

gamesheet_sdk.teams.fetch_seasons_raw(session, *, timeout=15.0)[source]ΒΆ

Fetch raw seasons data from the teams API gateway.

Parameters:
Returns:

list[dict[str, Any]] – List of raw season dictionaries from the API response.

Raises:
Return type:

list[dict[str, Any]]

gamesheet_sdk.teams.fetch_team_raw(session, team_id, *, timeout=15.0)[source]ΒΆ

Fetch raw data for a single team from the teams API gateway.

Parameters:
Returns:

dict[str, Any] – Raw team dictionary from the API response.

Raises:
Return type:

dict[str, Any]

gamesheet_sdk.teams.fetch_teams_raw(session, *, timeout=15.0)[source]ΒΆ

Fetch raw teams data from the teams API gateway.

Parameters:
Returns:

list[dict[str, Any]] – List of raw team dictionaries from the API response.

Raises:
Return type:

list[dict[str, Any]]

gamesheet_sdk.teams.get_calendar_subscription(team_id, *, timestamp_hours=None)[source]ΒΆ

Generate calendar subscription URLs for a team.

Calculates subscription URLs for Apple Calendar (webcal), Google Calendar, and generic calendar feed.

Parameters:
  • team_id (str) – Team identifier (prototeamId UUID or team ID).

  • timestamp_hours (int | None) – Optional hours timestamp since Unix epoch for cache busting (defaults to current UTC hour).

Returns:

CalendarSubscription – Pydantic model with appleCalendar, googleCalendar, and calendarUrl.

Return type:

CalendarSubscription

gamesheet_sdk.teams.get_event(session, event_id, *, include_availability=False, team_id=None, timeout=15.0)[source]ΒΆ

Retrieve detailed metadata for a calendar event (β€˜event’ type).

Parameters:
  • session (BaseAuthenticatedSession) – Authenticated session instance.

  • event_id (str | int) – Identifier of the event occurrence.

  • include_availability (bool) – Whether to fetch and include team availability.

  • team_id (str | int | None) – Optional team ID for availability lookup.

  • timeout (float) – Request timeout in seconds.

Returns:

ScheduleEventDetail – Event details model.

Return type:

ScheduleEventDetail

gamesheet_sdk.teams.get_game(session, event_id, *, include_availability=False, team_id=None, timeout=15.0)[source]ΒΆ

Retrieve detailed metadata for a scheduled game (β€˜game’ type).

Parameters:
  • session (BaseAuthenticatedSession) – Authenticated session instance.

  • event_id (str | int) – Identifier of the game occurrence.

  • include_availability (bool) – Whether to fetch and include team availability.

  • team_id (str | int | None) – Optional team ID for availability lookup.

  • timeout (float) – Request timeout in seconds.

Returns:

ScheduleEventDetail – Game details model.

Return type:

ScheduleEventDetail

gamesheet_sdk.teams.get_practice(session, event_id, *, include_availability=False, team_id=None, timeout=15.0)[source]ΒΆ

Retrieve detailed metadata for a practice (β€˜practice’ type).

Parameters:
  • session (BaseAuthenticatedSession) – Authenticated session instance.

  • event_id (str | int) – Identifier of the practice occurrence.

  • include_availability (bool) – Whether to fetch and include team availability.

  • team_id (str | int | None) – Optional team ID for availability lookup.

  • timeout (float) – Request timeout in seconds.

Returns:

ScheduleEventDetail – Practice details model.

Return type:

ScheduleEventDetail

gamesheet_sdk.teams.get_schedule_event(session, event_id, *, event_type=None, include_availability=False, team_id=None, timeout=15.0)[source]ΒΆ

Retrieve detailed metadata for a calendar event occurrence or scheduled game.

Parameters:
  • session (BaseAuthenticatedSession) – Authenticated session instance.

  • event_id (str | int) – Identifier of the event occurrence or game ID.

  • event_type (str | None) – Expected event type (β€˜event’, β€˜game’, β€˜practice’).

  • include_availability (bool) – Whether to fetch and include team availability.

  • team_id (str | int | None) – Optional team ID (used when fetching availability).

  • timeout (float) – Request timeout in seconds.

Returns:

ScheduleEventDetail – Detailed schedule event occurrence or game model.

Raises:

GameSheetError – If the server returns an error, event type mismatches, or team ID is missing for availability.

Return type:

ScheduleEventDetail

gamesheet_sdk.teams.get_season(session, season_id, *, timeout=15.0)[source]ΒΆ

Retrieve detailed information for a specific season, excluding penaltyCodes and teams.

Parameters:
  • session (BaseAuthenticatedSession) – Authenticated HTTP session.

  • season_id (str | int) – Identifier of the season to retrieve.

  • timeout (float) – HTTP request timeout in seconds.

Returns:

SeasonDetail – SeasonDetail with season attributes (excluding penaltyCodes and teams).

Return type:

SeasonDetail

gamesheet_sdk.teams.get_season_penalty_codes(session, season_id, *, timeout=15.0)[source]ΒΆ

Retrieve all penalty codes configured for a specific season.

Parameters:
  • session (BaseAuthenticatedSession) – Authenticated HTTP session.

  • season_id (str | int) – Identifier of the season.

  • timeout (float) – HTTP request timeout in seconds.

Returns:

list[PenaltyCode] – List of PenaltyCode objects for the season.

Return type:

list[PenaltyCode]

gamesheet_sdk.teams.get_season_teams(session, season_id, *, timeout=15.0)[source]ΒΆ

Retrieve all teams participating in a specific season.

Parameters:
  • session (BaseAuthenticatedSession) – Authenticated HTTP session.

  • season_id (str | int) – Identifier of the season.

  • timeout (float) – HTTP request timeout in seconds.

Returns:

list[SeasonTeam] – List of SeasonTeam objects for the season.

Return type:

list[SeasonTeam]

gamesheet_sdk.teams.get_team(session, team_id, *, timeout=15.0)[source]ΒΆ

Retrieve detailed information for a specific team.

Parameters:
  • session (BaseAuthenticatedSession) – Authenticated HTTP session.

  • team_id (str | int) – Identifier of the team to retrieve.

  • timeout (float) – HTTP request timeout in seconds.

Returns:

TeamDetail – TeamDetail with team attributes.

Return type:

TeamDetail

gamesheet_sdk.teams.list_events(session, team_id, *, month='all', include_event_data=False, timeout=15.0)[source]ΒΆ

List calendar events (β€˜event’ type) for a team.

Parameters:
  • session (BaseAuthenticatedSession) – Authenticated session instance.

  • team_id (str) – Team identifier.

  • month (str) – Month filter for calendar events (default: β€˜all’).

  • include_event_data (bool) – Whether to include detailed eventData in models (default: False).

  • timeout (float) – Request timeout in seconds.

Returns:

list[ScheduleEvent] – List of calendar events.

Return type:

list[ScheduleEvent]

gamesheet_sdk.teams.list_games(session, team_id, *, month='all', include_event_data=False, timeout=15.0)[source]ΒΆ

List scheduled games (β€˜game’ type) for a team.

Parameters:
  • session (BaseAuthenticatedSession) – Authenticated session instance.

  • team_id (str) – Team identifier.

  • month (str) – Month filter for calendar events (default: β€˜all’).

  • include_event_data (bool) – Whether to include detailed eventData in models (default: False).

  • timeout (float) – Request timeout in seconds.

Returns:

list[ScheduleEvent] – List of scheduled games.

Return type:

list[ScheduleEvent]

gamesheet_sdk.teams.list_lookups(*, timeout=15.0)[source]ΒΆ

Fetch all lookup categories from the teams API.

This is a public endpoint β€” no authentication is required.

Parameters:

timeout (float) – HTTP request timeout in seconds.

Returns:

dict[str, list[LookupValue]] –

Dictionary mapping category names to lists of LookupValue

objects.

Raises:

GameSheetError – If the server returns a non-2xx status code.

Return type:

dict[str, list[LookupValue]]

gamesheet_sdk.teams.list_practices(session, team_id, *, month='all', include_event_data=False, timeout=15.0)[source]ΒΆ

List practices (β€˜practice’ type) for a team.

Parameters:
  • session (BaseAuthenticatedSession) – Authenticated session instance.

  • team_id (str) – Team identifier.

  • month (str) – Month filter for calendar events (default: β€˜all’).

  • include_event_data (bool) – Whether to include detailed eventData in models (default: False).

  • timeout (float) – Request timeout in seconds.

Returns:

list[ScheduleEvent] – List of team practices.

Return type:

list[ScheduleEvent]

gamesheet_sdk.teams.list_schedule(session, team_id, *, event_type=None, month='all', include_event_data=False, timeout=15.0)[source]ΒΆ

List schedule events for a team, optionally filtered by event type.

Parameters:
  • session (BaseAuthenticatedSession) – Authenticated session instance.

  • team_id (str) – Team identifier.

  • event_type (str | None) – Optional event type filter (β€˜event’, β€˜game’, β€˜practice’).

  • month (str) – Month filter for calendar events (default: β€˜all’).

  • include_event_data (bool) – Whether to include detailed eventData in models (default: False).

  • timeout (float) – Request timeout in seconds.

Returns:

list[ScheduleEvent] – List of parsed schedule event models.

Raises:

GameSheetError – If the server returns malformed data.

Return type:

list[ScheduleEvent]

gamesheet_sdk.teams.list_seasons(session, *, timeout=15.0)[source]ΒΆ

Fetch and summarize all seasons available to the authenticated user.

Parameters:
Returns:

list[SeasonSummary] – List of SeasonSummary objects.

Return type:

list[SeasonSummary]

gamesheet_sdk.teams.list_teams(session, *, timeout=15.0)[source]ΒΆ

Fetch and summarize all teams available to the authenticated user.

Parameters:
Returns:

list[TeamSummary] – List of TeamSummary objects.

Return type:

list[TeamSummary]

gamesheet_sdk.teams.refresh_access_token(refresh_token, *, timeout=15.0)[source]ΒΆ

Exchange a refresh token for a fresh {access, refresh} pair via the teams API gateway.

POSTs to TEAMS_REFRESH_PATH with Authorization: Bearer <refresh_token> and an empty JSON body. The gateway returns a new access token and a replacement refresh token.

This is a standalone HTTP call that does not use a Session, so it can be called from inside an auto-refresh retry path without recursing.

Parameters:
  • refresh_token (str) – The refresh token to exchange for new tokens.

  • timeout (float) – Request timeout in seconds. Defaults to DEFAULT_TIMEOUT_S.

Returns:

dict[str, str] –

Dictionary with keys access and refresh, each containing the corresponding

token string.

Raises:
  • AuthenticationError – If the refresh token is rejected (HTTP 401). This typically means the token has expired and the user needs to re-authenticate via gamesheet-teams login.

  • GameSheetError – For any other non-2xx HTTP response from the token refresh endpoint.

Return type:

dict[str, str]

gamesheet_sdk.teams.restore_team(session, team_id, *, timeout=15.0)[source]ΒΆ

Restore an archived team back to active lists.

Parameters:
  • session (BaseAuthenticatedSession) – Authenticated HTTP session.

  • team_id (str | int) – Identifier of the team to restore.

  • timeout (float) – Request timeout in seconds.

Returns:

TeamDetail – TeamDetail representing the restored team.

Return type:

TeamDetail

gamesheet_sdk.teams.unarchive_team(session, team_id, *, timeout=15.0)ΒΆ

Restore an archived team back to active lists.

Parameters:
  • session (BaseAuthenticatedSession) – Authenticated HTTP session.

  • team_id (str | int) – Identifier of the team to restore.

  • timeout (float) – Request timeout in seconds.

Returns:

TeamDetail – TeamDetail representing the restored team.

Return type:

TeamDetail

gamesheet_sdk.teams.update_calendar_occurrence(session, occurrence_id, payload, *, update_future=False, timeout=15.0)[source]ΒΆ

Update a calendar occurrence and return validated CalendarEventCreated model.

Parameters:
  • session (BaseAuthenticatedSession) – Authenticated session instance.

  • occurrence_id (str) – UUID of the occurrence to update.

  • payload (dict[str, Any]) – Dictionary containing fields to update.

  • update_future (bool) – If True, updates this and all future occurrences.

  • timeout (float) – Request timeout in seconds.

Returns:

CalendarEventCreated – Validated response model.

Raises:

GameSheetError – If the server returns an error.

Return type:

CalendarEventCreated

gamesheet_sdk.teams.update_calendar_occurrence_raw(session, occurrence_id, payload, *, update_future=False, timeout=15.0)[source]ΒΆ

Execute raw HTTP PUT request to update an occurrence via PUT /api/calendar/occurrences/{occurrence_id}.

Parameters:
  • session (BaseAuthenticatedSession) – Authenticated session instance.

  • occurrence_id (str) – Identifier of the occurrence to update.

  • payload (dict[str, Any]) – Occurrence update payload.

  • update_future (bool) – Whether to update this and all future occurrences (default: False).

  • timeout (float) – Request timeout in seconds.

Returns:

dict[str, Any] – Parsed JSON response from the API.

Raises:
Return type:

dict[str, Any]

gamesheet_sdk.teams.update_event(session, occurrence_id, *, title=None, notes=None, location_name=None, start_date=None, end_date=None, rrule=None, update_future=False, timeout=15.0)[source]ΒΆ

Update a non-game calendar event occurrence.

Parameters:
  • session (BaseAuthenticatedSession) – Authenticated session instance.

  • occurrence_id (str) – Occurrence identifier (UUID).

  • title (str | None) – Event title.

  • notes (str | None) – Event notes / description.

  • location_name (str | None) – Venue / location name.

  • start_date (str | None) – ISO formatted start datetime (UTC).

  • end_date (str | None) – ISO formatted end datetime (UTC).

  • rrule (str | None) – RRULE recurrence rule string.

  • update_future (bool) – Update future occurrences if recurring.

  • timeout (float) – Request timeout in seconds.

Returns:

CalendarEventCreated – Validated response model.

Return type:

CalendarEventCreated

gamesheet_sdk.teams.update_game(session, game_id, *, team_id=None, season_id=None, division_id=None, opposing_team_id=None, opposing_division=None, association_id=None, league_id=None, home_flag=None, date_time=None, end_time=None, game_number=None, game_type=None, location=None, scorekeeper_name=None, scorekeeper_phone=None, broadcast_provider=None, time_zone_name=None, time_zone_offset=None, timeout=15.0)[source]ΒΆ

Update a scheduled game via the teams schedule-game endpoint.

Parameters:
  • session (BaseAuthenticatedSession) – Authenticated session instance.

  • game_id (int | str) – Identifier of the game to update.

  • team_id (int | str | None) – Team identifier.

  • season_id (int | str | None) – Season identifier.

  • division_id (int | str | None) – Division identifier.

  • opposing_team_id (int | str | None) – Opposing team identifier.

  • opposing_division (int | str | None) – Opposing division identifier.

  • association_id (int | str | None) – Association identifier.

  • league_id (int | str | None) – League identifier.

  • home_flag (bool | None) – Whether the team is the home team.

  • date_time (str | None) – Start date/time (e.g. β€˜2026-08-24T15:00’).

  • end_time (str | None) – End time (e.g. β€˜16:15’).

  • game_number (str | None) – Game number.

  • game_type (str | None) – Game type.

  • location (str | None) – Game location / venue.

  • scorekeeper_name (str | None) – Scorekeeper name.

  • scorekeeper_phone (str | None) – Scorekeeper phone.

  • broadcast_provider (str | None) – Broadcast provider key.

  • time_zone_name (str | None) – IANA timezone name.

  • time_zone_offset (int | None) – Timezone offset in minutes.

  • timeout (float) – Request timeout in seconds.

Returns:

UpdatedGameResult – Result containing updated game details.

Return type:

UpdatedGameResult

gamesheet_sdk.teams.update_practice(session, occurrence_id, *, title=None, start_date=None, end_date=None, notes=None, location_name=None, rrule=None, update_future=False, timeout=15.0)[source]ΒΆ

Update a practice occurrence.

Parameters:
  • session (BaseAuthenticatedSession) – Authenticated session instance.

  • occurrence_id (str) – Identifier of the occurrence to update.

  • title (str | None) – Practice title.

  • start_date (str | None) – ISO start datetime string.

  • end_date (str | None) – ISO end datetime string.

  • notes (str | None) – Practice notes or description.

  • location_name (str | None) – Venue or location address.

  • rrule (str | None) – Recurrence rule.

  • update_future (bool) – If True, update this and future occurrences.

  • timeout (float) – Request timeout in seconds.

Returns:

CalendarEventCreated – Updated occurrence details model.

Return type:

CalendarEventCreated

gamesheet_sdk.teams.update_schedule_game_raw(session, game_id, payload, *, timeout=15.0)[source]ΒΆ

Execute raw HTTP PUT request to update a scheduled game via PUT /api/schedule-game/{game_id}.

Parameters:
  • session (BaseAuthenticatedSession) – Authenticated session instance.

  • game_id (int | str) – Identifier of the scheduled game to update.

  • payload (dict[str, Any]) – Game update payload.

  • timeout (float) – Request timeout in seconds.

Returns:

dict[str, Any] – Parsed JSON response from the API.

Raises:
Return type:

dict[str, Any]

gamesheet_sdk.teams.update_team(session, team_id, *, team_name=None, skill=None, team_logo=None, age_category=None, province=None, timeout=15.0, **extra_fields)[source]ΒΆ

Update an existing team’s metadata.

Parameters:
  • session (BaseAuthenticatedSession) – Authenticated HTTP session.

  • team_id (str | int) – Identifier of the team to update.

  • team_name (str | None) – New name of the team.

  • skill (str | None) – Skill level of the team.

  • team_logo (str | None) – Local image file path or existing image URL.

  • age_category (str | None) – Age category of the team.

  • province (str | None) – Province or state code.

  • timeout (float) – Request timeout in seconds.

  • **extra_fields (Any) – Any additional fields to include in the PATCH payload.

Returns:

TeamDetail – TeamDetail with the updated team attributes.

Raises:
Return type:

TeamDetail

gamesheet_sdk.teams.upload_team_image(session, image_path, image_type='logo', *, timeout=15.0)[source]ΒΆ

Upload an image to Cloudflare via the Teams upload URL endpoint.

Parameters:
  • session (BaseAuthenticatedSession) – Authenticated HTTP session.

  • image_path (str) – Path to a local image file.

  • image_type (str) – Type of image for error messages (e.g., β€œlogo”).

  • timeout (float) – Request timeout in seconds.

Returns:

str – The Cloudflare CDN URL for the uploaded image.

Raises:
Return type:

str

gamesheet_sdk.teams.validate_game_type(game_type)[source]ΒΆ

Validate a game type against known valid types.

Parameters:

game_type (str) – The game type to validate.

Raises:

GameSheetError – If the game type is not valid.