gamesheet_sdk.teamsΒΆ
Teams dashboard SDK for GameSheet.
Functions
|
Archive a team to remove it from active lists while preserving data. |
|
Build an RRULE string for recurring events. |
|
Create a calendar event or practice via POST /api/calendar/events. |
|
Create a calendar event ('event' or 'practice' type). |
|
Create a scheduled game via the teams schedule-game endpoint. |
|
Create a practice calendar event ('practice' type). |
|
Create a scheduled game via POST /api/schedule-game. |
|
Delete a calendar event and all of its occurrences. |
|
Execute raw HTTP DELETE request to delete a calendar event series. |
|
Delete a calendar occurrence (optionally including all future occurrences). |
|
Execute raw HTTP DELETE request to delete a calendar occurrence. |
|
Delete a calendar event series or occurrence. |
|
Delete a scheduled game. |
|
Delete a practice calendar event series or occurrence. |
|
Execute raw HTTP DELETE request to delete a scheduled game via DELETE /api/schedule-game/{game_id}. |
|
Delete a team. |
|
Fetch batch availability data for a team event. |
|
Fetch raw calendar data from the teams API for a specified team. |
|
Fetch raw calendar event occurrence data from the teams API. |
|
Fetch raw game details from the teams schedule-game API. |
|
Fetch raw seasons data from the teams API gateway. |
|
Fetch raw data for a single team from the teams API gateway. |
|
Fetch raw teams data from the teams API gateway. |
|
Generate calendar subscription URLs for a team. |
|
Retrieve detailed metadata for a calendar event ('event' type). |
|
Retrieve detailed metadata for a scheduled game ('game' type). |
|
Retrieve detailed metadata for a practice ('practice' type). |
|
Retrieve detailed metadata for a calendar event occurrence or scheduled game. |
|
Retrieve detailed information for a specific season, excluding penaltyCodes and teams. |
|
Retrieve all penalty codes configured for a specific season. |
|
Retrieve all teams participating in a specific season. |
|
Retrieve detailed information for a specific team. |
|
List calendar events ('event' type) for a team. |
|
List scheduled games ('game' type) for a team. |
|
Fetch all lookup categories from the teams API. |
|
List practices ('practice' type) for a team. |
|
List schedule events for a team, optionally filtered by event type. |
|
Fetch and summarize all seasons available to the authenticated user. |
|
Fetch and summarize all teams available to the authenticated user. |
|
Exchange a refresh token for a fresh |
|
Restore an archived team back to active lists. |
|
Restore an archived team back to active lists. |
|
Update a calendar occurrence and return validated CalendarEventCreated model. |
|
Execute raw HTTP PUT request to update an occurrence via PUT /api/calendar/occurrences/{occurrence_id}. |
|
Update a non-game calendar event occurrence. |
|
Update a scheduled game via the teams schedule-game endpoint. |
|
Update a practice occurrence. |
|
Execute raw HTTP PUT request to update a scheduled game via PUT /api/schedule-game/{game_id}. |
|
Update an existing team's metadata. |
|
Upload an image to Cloudflare via the Teams upload URL endpoint. |
|
Validate a game type against known valid types. |
Classes
Details of a newly created or updated calendar event or practice. |
|
Calendar subscription URLs for Apple Calendar, Google Calendar, and webcal. |
|
Result of creating a scheduled game. |
|
A single value within a lookup category. |
|
A penalty code configured for a season. |
|
Result returned from a schedule deletion operation. |
|
Calendar event or scheduled activity for a team. |
|
Detailed metadata for a calendar event occurrence. |
|
Detailed season metadata with penaltyCodes and teams excluded. |
|
Summary of a season for list views. |
|
A team participating in a season. |
|
Detailed information for a single team. |
|
Summary of a team for list views. |
|
Teams-pillar session that refreshes via the teams API gateway. |
|
HTTP-based |
|
Result of updating a scheduled game. |
- class gamesheet_sdk.teams.CalendarEventCreated[source]ΒΆ
Bases:
BaseModelDetails of a newly created or updated calendar event or practice.
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].
- __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.
- 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)ΒΆ
- 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:
- 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:
- 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]).
- 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:
- 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:
- 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:
βany_ofβ: Use the [anyOf](https://json-schema.org/understanding-json-schema/reference/combining#anyOf)
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:
- 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:
- 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:
- 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:
- 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:
- classmethod parse_file(path, *, content_type=None, encoding='utf8', proto=None, allow_pickle=False)ΒΆ
- Return type:
Self
- classmethod parse_raw(b, *, content_type=None, encoding='utf8', proto=None, allow_pickle=False)ΒΆ
- Return type:
Self
- classmethod schema_json(*, by_alias=True, ref_template='#/$defs/{model}', **dumps_kwargs)ΒΆ
- Return type:
- classmethod update_forward_refs(**localns)ΒΆ
- class gamesheet_sdk.teams.CalendarSubscription[source]ΒΆ
Bases:
BaseModelCalendar subscription URLs for Apple Calendar, Google Calendar, and webcal.
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].
- __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.
- 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)ΒΆ
- 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:
- 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:
- 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]).
- 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:
- 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:
- 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:
βany_ofβ: Use the [anyOf](https://json-schema.org/understanding-json-schema/reference/combining#anyOf)
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:
- 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:
- 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:
- 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:
- 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:
- classmethod parse_file(path, *, content_type=None, encoding='utf8', proto=None, allow_pickle=False)ΒΆ
- Return type:
Self
- classmethod parse_raw(b, *, content_type=None, encoding='utf8', proto=None, allow_pickle=False)ΒΆ
- Return type:
Self
- classmethod schema_json(*, by_alias=True, ref_template='#/$defs/{model}', **dumps_kwargs)ΒΆ
- Return type:
- classmethod update_forward_refs(**localns)ΒΆ
- class gamesheet_sdk.teams.CreatedGameResult[source]ΒΆ
Bases:
BaseModelResult of creating a scheduled game.
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].
- __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.
- 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)ΒΆ
- 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:
- 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:
- 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]).
- 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:
- 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:
- 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:
βany_ofβ: Use the [anyOf](https://json-schema.org/understanding-json-schema/reference/combining#anyOf)
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:
- 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:
- 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:
- 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:
- 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:
- classmethod parse_file(path, *, content_type=None, encoding='utf8', proto=None, allow_pickle=False)ΒΆ
- Return type:
Self
- classmethod parse_raw(b, *, content_type=None, encoding='utf8', proto=None, allow_pickle=False)ΒΆ
- Return type:
Self
- classmethod schema_json(*, by_alias=True, ref_template='#/$defs/{model}', **dumps_kwargs)ΒΆ
- Return type:
- classmethod update_forward_refs(**localns)ΒΆ
- class gamesheet_sdk.teams.LookupValue[source]ΒΆ
Bases:
BaseModelA single value within a lookup category.
All lookup values carry a
key. Most also have atitle; the few that donβt (e.g. entitlements) default to"". Category-specific fields (abbr,url,sport,scopes, etc.) are preserved viaextra="allow"and appear inmodel_dump()output.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].
- __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.
- 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)ΒΆ
- 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:
- 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:
- 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]).
- 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:
- 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:
- 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:
βany_ofβ: Use the [anyOf](https://json-schema.org/understanding-json-schema/reference/combining#anyOf)
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:
- 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:
- 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:
- 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:
- 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:
- classmethod parse_file(path, *, content_type=None, encoding='utf8', proto=None, allow_pickle=False)ΒΆ
- Return type:
Self
- classmethod parse_raw(b, *, content_type=None, encoding='utf8', proto=None, allow_pickle=False)ΒΆ
- Return type:
Self
- classmethod schema_json(*, by_alias=True, ref_template='#/$defs/{model}', **dumps_kwargs)ΒΆ
- Return type:
- classmethod update_forward_refs(**localns)ΒΆ
- class gamesheet_sdk.teams.PenaltyCode[source]ΒΆ
Bases:
BaseModelA penalty code configured for a season.
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].
- __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.
- 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)ΒΆ
- 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:
- 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:
- 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]).
- 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:
- 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:
- 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:
βany_ofβ: Use the [anyOf](https://json-schema.org/understanding-json-schema/reference/combining#anyOf)
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:
- 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:
- 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:
- 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:
- 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:
- classmethod parse_file(path, *, content_type=None, encoding='utf8', proto=None, allow_pickle=False)ΒΆ
- Return type:
Self
- classmethod parse_raw(b, *, content_type=None, encoding='utf8', proto=None, allow_pickle=False)ΒΆ
- Return type:
Self
- classmethod schema_json(*, by_alias=True, ref_template='#/$defs/{model}', **dumps_kwargs)ΒΆ
- Return type:
- classmethod update_forward_refs(**localns)ΒΆ
- class gamesheet_sdk.teams.ScheduleDeleteResult[source]ΒΆ
Bases:
BaseModelResult returned from a schedule deletion operation.
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].
- __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.
- 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)ΒΆ
- 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:
- 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:
- 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]).
- 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:
- 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:
- 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:
βany_ofβ: Use the [anyOf](https://json-schema.org/understanding-json-schema/reference/combining#anyOf)
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:
- 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:
- 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:
- 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:
- 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:
- classmethod parse_file(path, *, content_type=None, encoding='utf8', proto=None, allow_pickle=False)ΒΆ
- Return type:
Self
- classmethod parse_raw(b, *, content_type=None, encoding='utf8', proto=None, allow_pickle=False)ΒΆ
- Return type:
Self
- classmethod schema_json(*, by_alias=True, ref_template='#/$defs/{model}', **dumps_kwargs)ΒΆ
- Return type:
- classmethod update_forward_refs(**localns)ΒΆ
- class gamesheet_sdk.teams.ScheduleEvent[source]ΒΆ
Bases:
BaseModelCalendar event or scheduled activity for a team.
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].
- __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.
- 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)ΒΆ
- 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:
- 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:
- 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]).
- 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:
- 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:
- 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:
βany_ofβ: Use the [anyOf](https://json-schema.org/understanding-json-schema/reference/combining#anyOf)
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:
- 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:
- 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:
- 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:
- 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:
- classmethod parse_file(path, *, content_type=None, encoding='utf8', proto=None, allow_pickle=False)ΒΆ
- Return type:
Self
- classmethod parse_raw(b, *, content_type=None, encoding='utf8', proto=None, allow_pickle=False)ΒΆ
- Return type:
Self
- classmethod schema_json(*, by_alias=True, ref_template='#/$defs/{model}', **dumps_kwargs)ΒΆ
- Return type:
- classmethod update_forward_refs(**localns)ΒΆ
- class gamesheet_sdk.teams.ScheduleEventDetail[source]ΒΆ
Bases:
BaseModelDetailed metadata for a calendar event occurrence.
- 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].
- 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.
- 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)ΒΆ
- 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:
- 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:
- 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]).
- 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:
- 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:
- 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:
βany_ofβ: Use the [anyOf](https://json-schema.org/understanding-json-schema/reference/combining#anyOf)
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:
- 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:
- 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:
- 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:
- 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:
- classmethod parse_file(path, *, content_type=None, encoding='utf8', proto=None, allow_pickle=False)ΒΆ
- Return type:
Self
- classmethod parse_raw(b, *, content_type=None, encoding='utf8', proto=None, allow_pickle=False)ΒΆ
- Return type:
Self
- classmethod schema_json(*, by_alias=True, ref_template='#/$defs/{model}', **dumps_kwargs)ΒΆ
- Return type:
- classmethod update_forward_refs(**localns)ΒΆ
- class gamesheet_sdk.teams.SeasonDetail[source]ΒΆ
Bases:
BaseModelDetailed season metadata with penaltyCodes and teams excluded.
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].
- __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.
- 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)ΒΆ
- 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:
- 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:
- 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]).
- 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:
- 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:
- 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:
βany_ofβ: Use the [anyOf](https://json-schema.org/understanding-json-schema/reference/combining#anyOf)
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:
- 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:
- 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:
- 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:
- 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:
- classmethod parse_file(path, *, content_type=None, encoding='utf8', proto=None, allow_pickle=False)ΒΆ
- Return type:
Self
- classmethod parse_raw(b, *, content_type=None, encoding='utf8', proto=None, allow_pickle=False)ΒΆ
- Return type:
Self
- classmethod schema_json(*, by_alias=True, ref_template='#/$defs/{model}', **dumps_kwargs)ΒΆ
- Return type:
- classmethod update_forward_refs(**localns)ΒΆ
- class gamesheet_sdk.teams.SeasonSummary[source]ΒΆ
Bases:
BaseModelSummary of a season for list views.
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].
- __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.
- 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)ΒΆ
- 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:
- 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:
- 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]).
- 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:
- 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:
- 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:
βany_ofβ: Use the [anyOf](https://json-schema.org/understanding-json-schema/reference/combining#anyOf)
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:
- 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:
- 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:
- 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:
- 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:
- classmethod parse_file(path, *, content_type=None, encoding='utf8', proto=None, allow_pickle=False)ΒΆ
- Return type:
Self
- classmethod parse_raw(b, *, content_type=None, encoding='utf8', proto=None, allow_pickle=False)ΒΆ
- Return type:
Self
- classmethod schema_json(*, by_alias=True, ref_template='#/$defs/{model}', **dumps_kwargs)ΒΆ
- Return type:
- classmethod update_forward_refs(**localns)ΒΆ
- class gamesheet_sdk.teams.SeasonTeam[source]ΒΆ
Bases:
BaseModelA team participating in a season.
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].
- __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.
- 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)ΒΆ
- 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:
- 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:
- 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]).
- 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:
- 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:
- 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:
βany_ofβ: Use the [anyOf](https://json-schema.org/understanding-json-schema/reference/combining#anyOf)
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:
- 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:
- 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:
- 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:
- 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:
- classmethod parse_file(path, *, content_type=None, encoding='utf8', proto=None, allow_pickle=False)ΒΆ
- Return type:
Self
- classmethod parse_raw(b, *, content_type=None, encoding='utf8', proto=None, allow_pickle=False)ΒΆ
- Return type:
Self
- classmethod schema_json(*, by_alias=True, ref_template='#/$defs/{model}', **dumps_kwargs)ΒΆ
- Return type:
- classmethod update_forward_refs(**localns)ΒΆ
- class gamesheet_sdk.teams.TeamDetail[source]ΒΆ
Bases:
BaseModelDetailed information for a single team.
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].
- __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.
- 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)ΒΆ
- 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:
- 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:
- 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]).
- 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:
- 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:
- 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:
βany_ofβ: Use the [anyOf](https://json-schema.org/understanding-json-schema/reference/combining#anyOf)
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:
- 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:
- 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:
- 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:
- 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:
- classmethod parse_file(path, *, content_type=None, encoding='utf8', proto=None, allow_pickle=False)ΒΆ
- Return type:
Self
- classmethod parse_raw(b, *, content_type=None, encoding='utf8', proto=None, allow_pickle=False)ΒΆ
- Return type:
Self
- classmethod schema_json(*, by_alias=True, ref_template='#/$defs/{model}', **dumps_kwargs)ΒΆ
- Return type:
- classmethod update_forward_refs(**localns)ΒΆ
- class gamesheet_sdk.teams.TeamSummary[source]ΒΆ
Bases:
BaseModelSummary of a team for list views.
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].
- __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.
- 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)ΒΆ
- 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:
- 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:
- 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]).
- 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:
- 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:
- 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:
βany_ofβ: Use the [anyOf](https://json-schema.org/understanding-json-schema/reference/combining#anyOf)
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:
- 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:
- 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:
- 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:
- 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:
- classmethod parse_file(path, *, content_type=None, encoding='utf8', proto=None, allow_pickle=False)ΒΆ
- Return type:
Self
- classmethod parse_raw(b, *, content_type=None, encoding='utf8', proto=None, allow_pickle=False)ΒΆ
- Return type:
Self
- classmethod schema_json(*, by_alias=True, ref_template='#/$defs/{model}', **dumps_kwargs)ΒΆ
- Return type:
- classmethod update_forward_refs(**localns)ΒΆ
- class gamesheet_sdk.teams.TeamsAuthenticatedSession[source]ΒΆ
Bases:
BaseAuthenticatedSessionTeams-pillar session that refreshes via the teams API gateway.
Delegates to
refresh_access_token(), which POSTs to the teams gatewayβs/api/auth/refreshendpoint.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:
- __init__(config=None, *, access_token, refresh_token, on_refresh=None)ΒΆ
Initialize BaseAuthenticatedSession instance.
- 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.
- 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 forrequests.Session.headers.- Returns:
MutableMapping[str, str | bytes] β Return value.
- request(method, url, *, timeout=None, **kwargs)ΒΆ
Send a request, refreshing the bearer and retrying once on 401 or 403.
- Parameters:
- 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:
- 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.
- class gamesheet_sdk.teams.TeamsLoginFlow[source]ΒΆ
Bases:
objectHTTP-based
LoginFlowfor the teams dashboard.Authenticates via two sequential HTTP calls β Firebase REST
signInWithPasswordfollowed 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:
- Returns:
dict[str, str] β Token bundle with
"access"and"refresh"keys.- Return type:
- class gamesheet_sdk.teams.UpdatedGameResult[source]ΒΆ
Bases:
BaseModelResult of updating a scheduled game.
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].
- __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.
- 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)ΒΆ
- 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:
- 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:
- 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]).
- 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:
- 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:
- 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:
βany_ofβ: Use the [anyOf](https://json-schema.org/understanding-json-schema/reference/combining#anyOf)
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:
- 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:
- 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:
- 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:
- 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:
- classmethod parse_file(path, *, content_type=None, encoding='utf8', proto=None, allow_pickle=False)ΒΆ
- Return type:
Self
- classmethod parse_raw(b, *, content_type=None, encoding='utf8', proto=None, allow_pickle=False)ΒΆ
- Return type:
Self
- classmethod schema_json(*, by_alias=True, ref_template='#/$defs/{model}', **dumps_kwargs)ΒΆ
- Return type:
- classmethod update_forward_refs(**localns)ΒΆ
- 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.
timeout (float) β Request timeout in seconds.
- Returns:
TeamDetail β
TeamDetailrepresenting the archived team.- Return type:
- 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.
timeout (float) β Request timeout in seconds.
- Returns:
dict[str, Any] β Parsed JSON response from the API.
- Raises:
AuthenticationError β If the user is not authenticated (401).
GameSheetError β If the server returns an error or malformed response.
- Return type:
- 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:
- 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.
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:
- 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:
- 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.
timeout (float) β Request timeout in seconds.
- Returns:
dict[str, Any] β Parsed JSON response from the API.
- Raises:
AuthenticationError β If the user is not authenticated (401).
GameSheetError β If the server returns an error or malformed response.
- Return type:
- 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:
- 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:
AuthenticationError β If the user is not authenticated (401).
GameSheetError β If the server returns an error or malformed response.
- Return type:
- 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:
- 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:
AuthenticationError β If the user is not authenticated (401).
GameSheetError β If the server returns an error or malformed response.
- Return type:
- 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:
- gamesheet_sdk.teams.delete_game(session, game_id, *, timeout=15.0)[source]ΒΆ
Delete a scheduled game.
- Parameters:
session (BaseAuthenticatedSession) β Authenticated session instance.
timeout (float) β Request timeout in seconds.
- Returns:
ScheduleDeleteResult β Result of deletion containing success flag and message.
- Return type:
- 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:
- 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.
timeout (float) β Request timeout in seconds.
- Returns:
dict[str, Any] β Parsed JSON response from the API.
- Raises:
AuthenticationError β If the user is not authenticated (401).
GameSheetError β If the server returns an error or malformed response.
- Return type:
- gamesheet_sdk.teams.delete_team(session, team_id, *, timeout=15.0)[source]ΒΆ
Delete a team.
- Parameters:
session (BaseAuthenticatedSession) β Authenticated HTTP session.
timeout (float) β Request timeout in seconds.
- Raises:
AuthenticationError β If the server returns a 401 Unauthorized status.
GameSheetError β If the server returns a non-2xx status code.
- 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.
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:
AuthenticationError β If the user is not authenticated (401).
GameSheetError β If the server returns an error or malformed response.
- Return type:
- 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:
AuthenticationError β If the user is not authenticated (401).
GameSheetError β If the server returns an error or malformed response.
- Return type:
- 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:
AuthenticationError β If the user is not authenticated (401).
GameSheetError β If the server returns an error or malformed response.
- Return type:
- 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.
timeout (float) β Request timeout in seconds.
- Returns:
dict[str, Any] β Parsed JSON response from the schedule-game API.
- Raises:
AuthenticationError β If the user is not authenticated (401).
GameSheetError β If the server returns an error or malformed response.
- Return type:
- gamesheet_sdk.teams.fetch_seasons_raw(session, *, timeout=15.0)[source]ΒΆ
Fetch raw seasons data from the teams API gateway.
- Parameters:
session (BaseAuthenticatedSession) β Authenticated HTTP session.
timeout (float) β HTTP request timeout in seconds.
- Returns:
list[dict[str, Any]] β List of raw season dictionaries from the API response.
- Raises:
AuthenticationError β If the server returns a 401 Unauthorized status.
GameSheetError β If the server returns any other non-2xx status code.
- Return type:
- 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:
session (BaseAuthenticatedSession) β Authenticated HTTP session.
timeout (float) β Request timeout in seconds.
- Returns:
dict[str, Any] β Raw team dictionary from the API response.
- Raises:
AuthenticationError β If the server returns a 401 Unauthorized status.
GameSheetError β If the team is not found or the server returns an error.
- Return type:
- gamesheet_sdk.teams.fetch_teams_raw(session, *, timeout=15.0)[source]ΒΆ
Fetch raw teams data from the teams API gateway.
- Parameters:
session (BaseAuthenticatedSession) β Authenticated HTTP session.
timeout (float) β HTTP request timeout in seconds.
- Returns:
list[dict[str, Any]] β List of raw team dictionaries from the API response.
- Raises:
AuthenticationError β If the server returns a 401 Unauthorized status.
GameSheetError β If the server returns any other non-2xx status code.
- Return type:
- 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:
- Returns:
CalendarSubscription β Pydantic model with appleCalendar, googleCalendar, and calendarUrl.
- Return type:
- 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:
- 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.
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:
- 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:
- 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:
- 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 β
SeasonDetailwith season attributes (excluding penaltyCodes and teams).- Return type:
- 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.
timeout (float) β HTTP request timeout in seconds.
- Returns:
list[PenaltyCode] β List of
PenaltyCodeobjects for the season.- Return type:
- 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.
timeout (float) β HTTP request timeout in seconds.
- Returns:
list[SeasonTeam] β List of
SeasonTeamobjects for the season.- Return type:
- 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.
timeout (float) β HTTP request timeout in seconds.
- Returns:
TeamDetail β
TeamDetailwith team attributes.- Return type:
- 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:
- 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:
- 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.
- Dictionary mapping category names to lists of
- 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:
- 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:
- gamesheet_sdk.teams.list_seasons(session, *, timeout=15.0)[source]ΒΆ
Fetch and summarize all seasons available to the authenticated user.
- Parameters:
session (BaseAuthenticatedSession) β Authenticated HTTP session.
timeout (float) β HTTP request timeout in seconds.
- Returns:
list[SeasonSummary] β List of
SeasonSummaryobjects.- Return type:
- gamesheet_sdk.teams.list_teams(session, *, timeout=15.0)[source]ΒΆ
Fetch and summarize all teams available to the authenticated user.
- Parameters:
session (BaseAuthenticatedSession) β Authenticated HTTP session.
timeout (float) β HTTP request timeout in seconds.
- Returns:
list[TeamSummary] β List of
TeamSummaryobjects.- Return type:
- 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_PATHwithAuthorization: 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
accessandrefresh, each containing the corresponding token string.
- Dictionary with keys
- 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:
- 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.
timeout (float) β Request timeout in seconds.
- Returns:
TeamDetail β
TeamDetailrepresenting the restored team.- Return type:
- 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.
timeout (float) β Request timeout in seconds.
- Returns:
TeamDetail β
TeamDetailrepresenting the restored team.- Return type:
- 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:
- 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.
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:
AuthenticationError β If the user is not authenticated (401).
GameSheetError β If the server returns an error or malformed response.
- Return type:
- 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:
- 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.
opposing_team_id (int | str | None) β Opposing team identifier.
opposing_division (int | str | None) β Opposing division identifier.
association_id (int | str | None) β Association 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:
- 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:
- 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:
- Returns:
dict[str, Any] β Parsed JSON response from the API.
- Raises:
AuthenticationError β If the user is not authenticated (401).
GameSheetError β If the server returns an error or malformed response.
- Return type:
- 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_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 β
TeamDetailwith the updated team attributes.- Raises:
GameSheetError β If no update fields are provided or the server returns an error.
AuthenticationError β If the server returns a 401 Unauthorized status.
- Return type:
- 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:
GameSheetError β If the file does not exist, is not an image, or upload fails.
AuthenticationError β If the server returns 401 Unauthorized.
- Return type:
- 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.