gamesheet_sdk.teams.schedule package¶
Schedule and calendar data from the teams API.
The GET /api/calendar endpoint returns calendar events, games, and practices for a specified team.
The GET /api/calendar/occurrences/{id} endpoint returns detailed event occurrence data.
The GET /api/availability/batch endpoint returns player/coach availability for an event.
- class gamesheet_sdk.teams.schedule.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.schedule.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.schedule.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.schedule.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.schedule.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.schedule.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.schedule.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.schedule.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.schedule.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.schedule.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.schedule.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.schedule.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.schedule.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.schedule.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.schedule.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.schedule.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.schedule.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.schedule.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.schedule.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.schedule.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.schedule.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.schedule.fetch_availability_raw(session, team_id, event_id, event_type, *, timeout=15.0)[source]¶
Fetch batch availability data for a team event.
- Parameters:
- 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.schedule.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.schedule.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.
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.schedule.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.schedule.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.schedule.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.
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.schedule.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.schedule.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.schedule.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.schedule.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.schedule.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.schedule.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.schedule.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.schedule.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.schedule.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.schedule.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.schedule.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.
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.schedule.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.schedule.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.schedule.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.
Submodules¶
- gamesheet_sdk.teams.schedule.constants module
- gamesheet_sdk.teams.schedule.create module
- gamesheet_sdk.teams.schedule.delete module
- gamesheet_sdk.teams.schedule.models module
CalendarEventCreatedCalendarEventCreated.idCalendarEventCreated.event_idCalendarEventCreated.team_idCalendarEventCreated.prototeam_idCalendarEventCreated.titleCalendarEventCreated.typeCalendarEventCreated.notesCalendarEventCreated.location_nameCalendarEventCreated.location_addressCalendarEventCreated.location_surfaceCalendarEventCreated.timezone_nameCalendarEventCreated.all_dayCalendarEventCreated.is_overrideCalendarEventCreated.original_start_dateCalendarEventCreated.rruleCalendarEventCreated.start_dateCalendarEventCreated.end_dateCalendarEventCreated.start_timeCalendarEventCreated.end_timeCalendarEventCreated.created_by_user_idCalendarEventCreated.created_atCalendarEventCreated.updated_atCalendarEventCreated.deleted_atCalendarEventCreated.model_configCalendarEventCreated.idCalendarEventCreated.event_idCalendarEventCreated.team_idCalendarEventCreated.prototeam_idCalendarEventCreated.titleCalendarEventCreated.typeCalendarEventCreated.notesCalendarEventCreated.location_nameCalendarEventCreated.location_addressCalendarEventCreated.location_surfaceCalendarEventCreated.timezone_nameCalendarEventCreated.all_dayCalendarEventCreated.is_overrideCalendarEventCreated.original_start_dateCalendarEventCreated.rruleCalendarEventCreated.start_dateCalendarEventCreated.end_dateCalendarEventCreated.start_timeCalendarEventCreated.end_timeCalendarEventCreated.created_by_user_idCalendarEventCreated.created_atCalendarEventCreated.updated_atCalendarEventCreated.deleted_atCalendarEventCreated.__init__()CalendarEventCreated.construct()CalendarEventCreated.copy()CalendarEventCreated.dict()CalendarEventCreated.from_orm()CalendarEventCreated.json()CalendarEventCreated.model_computed_fieldsCalendarEventCreated.model_construct()CalendarEventCreated.model_copy()CalendarEventCreated.model_dump()CalendarEventCreated.model_dump_json()CalendarEventCreated.model_extraCalendarEventCreated.model_fieldsCalendarEventCreated.model_fields_setCalendarEventCreated.model_json_schema()CalendarEventCreated.model_parametrized_name()CalendarEventCreated.model_post_init()CalendarEventCreated.model_rebuild()CalendarEventCreated.model_validate()CalendarEventCreated.model_validate_json()CalendarEventCreated.model_validate_strings()CalendarEventCreated.parse_file()CalendarEventCreated.parse_obj()CalendarEventCreated.parse_raw()CalendarEventCreated.schema()CalendarEventCreated.schema_json()CalendarEventCreated.update_forward_refs()CalendarEventCreated.validate()
CalendarSubscriptionCalendarSubscription.appleCalendarCalendarSubscription.googleCalendarCalendarSubscription.calendarUrlCalendarSubscription.model_configCalendarSubscription.appleCalendarCalendarSubscription.googleCalendarCalendarSubscription.calendarUrlCalendarSubscription.__init__()CalendarSubscription.construct()CalendarSubscription.copy()CalendarSubscription.dict()CalendarSubscription.from_orm()CalendarSubscription.json()CalendarSubscription.model_computed_fieldsCalendarSubscription.model_construct()CalendarSubscription.model_copy()CalendarSubscription.model_dump()CalendarSubscription.model_dump_json()CalendarSubscription.model_extraCalendarSubscription.model_fieldsCalendarSubscription.model_fields_setCalendarSubscription.model_json_schema()CalendarSubscription.model_parametrized_name()CalendarSubscription.model_post_init()CalendarSubscription.model_rebuild()CalendarSubscription.model_validate()CalendarSubscription.model_validate_json()CalendarSubscription.model_validate_strings()CalendarSubscription.parse_file()CalendarSubscription.parse_obj()CalendarSubscription.parse_raw()CalendarSubscription.schema()CalendarSubscription.schema_json()CalendarSubscription.update_forward_refs()CalendarSubscription.validate()
CreatedGameResultCreatedGameResult.successCreatedGameResult.game_numberCreatedGameResult.date_timeCreatedGameResult.end_timeCreatedGameResult.game_typeCreatedGameResult.locationCreatedGameResult.team_idCreatedGameResult.opposing_team_idCreatedGameResult.season_idCreatedGameResult.association_idCreatedGameResult.league_idCreatedGameResult.division_idCreatedGameResult.opposing_divisionCreatedGameResult.home_flagCreatedGameResult.time_zone_nameCreatedGameResult.time_zone_offsetCreatedGameResult.scorekeeper_nameCreatedGameResult.scorekeeper_phoneCreatedGameResult.broadcast_providerCreatedGameResult.model_configCreatedGameResult.successCreatedGameResult.game_numberCreatedGameResult.date_timeCreatedGameResult.end_timeCreatedGameResult.game_typeCreatedGameResult.locationCreatedGameResult.team_idCreatedGameResult.opposing_team_idCreatedGameResult.season_idCreatedGameResult.association_idCreatedGameResult.league_idCreatedGameResult.division_idCreatedGameResult.opposing_divisionCreatedGameResult.home_flagCreatedGameResult.time_zone_nameCreatedGameResult.time_zone_offsetCreatedGameResult.scorekeeper_nameCreatedGameResult.scorekeeper_phoneCreatedGameResult.broadcast_providerCreatedGameResult.__init__()CreatedGameResult.construct()CreatedGameResult.copy()CreatedGameResult.dict()CreatedGameResult.from_orm()CreatedGameResult.json()CreatedGameResult.model_computed_fieldsCreatedGameResult.model_construct()CreatedGameResult.model_copy()CreatedGameResult.model_dump()CreatedGameResult.model_dump_json()CreatedGameResult.model_extraCreatedGameResult.model_fieldsCreatedGameResult.model_fields_setCreatedGameResult.model_json_schema()CreatedGameResult.model_parametrized_name()CreatedGameResult.model_post_init()CreatedGameResult.model_rebuild()CreatedGameResult.model_validate()CreatedGameResult.model_validate_json()CreatedGameResult.model_validate_strings()CreatedGameResult.parse_file()CreatedGameResult.parse_obj()CreatedGameResult.parse_raw()CreatedGameResult.schema()CreatedGameResult.schema_json()CreatedGameResult.update_forward_refs()CreatedGameResult.validate()
ScheduleDeleteResultScheduleDeleteResult.successScheduleDeleteResult.messageScheduleDeleteResult.idScheduleDeleteResult.model_configScheduleDeleteResult.successScheduleDeleteResult.messageScheduleDeleteResult.idScheduleDeleteResult.__init__()ScheduleDeleteResult.construct()ScheduleDeleteResult.copy()ScheduleDeleteResult.dict()ScheduleDeleteResult.from_orm()ScheduleDeleteResult.json()ScheduleDeleteResult.model_computed_fieldsScheduleDeleteResult.model_construct()ScheduleDeleteResult.model_copy()ScheduleDeleteResult.model_dump()ScheduleDeleteResult.model_dump_json()ScheduleDeleteResult.model_extraScheduleDeleteResult.model_fieldsScheduleDeleteResult.model_fields_setScheduleDeleteResult.model_json_schema()ScheduleDeleteResult.model_parametrized_name()ScheduleDeleteResult.model_post_init()ScheduleDeleteResult.model_rebuild()ScheduleDeleteResult.model_validate()ScheduleDeleteResult.model_validate_json()ScheduleDeleteResult.model_validate_strings()ScheduleDeleteResult.parse_file()ScheduleDeleteResult.parse_obj()ScheduleDeleteResult.parse_raw()ScheduleDeleteResult.schema()ScheduleDeleteResult.schema_json()ScheduleDeleteResult.update_forward_refs()ScheduleDeleteResult.validate()
ScheduleEventScheduleEvent.eventDateScheduleEvent.eventLocationScheduleEvent.eventTimeScheduleEvent.eventTitleScheduleEvent.idScheduleEvent.typeScheduleEvent.model_configScheduleEvent.eventDateScheduleEvent.eventLocationScheduleEvent.eventTimeScheduleEvent.eventTitleScheduleEvent.idScheduleEvent.typeScheduleEvent.__init__()ScheduleEvent.construct()ScheduleEvent.copy()ScheduleEvent.dict()ScheduleEvent.from_orm()ScheduleEvent.json()ScheduleEvent.model_computed_fieldsScheduleEvent.model_construct()ScheduleEvent.model_copy()ScheduleEvent.model_dump()ScheduleEvent.model_dump_json()ScheduleEvent.model_extraScheduleEvent.model_fieldsScheduleEvent.model_fields_setScheduleEvent.model_json_schema()ScheduleEvent.model_parametrized_name()ScheduleEvent.model_post_init()ScheduleEvent.model_rebuild()ScheduleEvent.model_validate()ScheduleEvent.model_validate_json()ScheduleEvent.model_validate_strings()ScheduleEvent.parse_file()ScheduleEvent.parse_obj()ScheduleEvent.parse_raw()ScheduleEvent.schema()ScheduleEvent.schema_json()ScheduleEvent.update_forward_refs()ScheduleEvent.validate()
ScheduleEventDetailScheduleEventDetail.idScheduleEventDetail.typeScheduleEventDetail.eventDateScheduleEventDetail.eventLocationScheduleEventDetail.eventTimeScheduleEventDetail.eventTitleScheduleEventDetail.eventDataScheduleEventDetail.availabilityScheduleEventDetail.model_configScheduleEventDetail.idScheduleEventDetail.typeScheduleEventDetail.eventDateScheduleEventDetail.eventLocationScheduleEventDetail.eventTimeScheduleEventDetail.eventTitleScheduleEventDetail.eventDataScheduleEventDetail.availabilityScheduleEventDetail.__init__()ScheduleEventDetail.construct()ScheduleEventDetail.copy()ScheduleEventDetail.dict()ScheduleEventDetail.from_orm()ScheduleEventDetail.json()ScheduleEventDetail.model_computed_fieldsScheduleEventDetail.model_construct()ScheduleEventDetail.model_copy()ScheduleEventDetail.model_dump()ScheduleEventDetail.model_dump_json()ScheduleEventDetail.model_extraScheduleEventDetail.model_fieldsScheduleEventDetail.model_fields_setScheduleEventDetail.model_json_schema()ScheduleEventDetail.model_parametrized_name()ScheduleEventDetail.model_post_init()ScheduleEventDetail.model_rebuild()ScheduleEventDetail.model_validate()ScheduleEventDetail.model_validate_json()ScheduleEventDetail.model_validate_strings()ScheduleEventDetail.parse_file()ScheduleEventDetail.parse_obj()ScheduleEventDetail.parse_raw()ScheduleEventDetail.schema()ScheduleEventDetail.schema_json()ScheduleEventDetail.update_forward_refs()ScheduleEventDetail.validate()
UpdatedGameResultUpdatedGameResult.successUpdatedGameResult.idUpdatedGameResult.messageUpdatedGameResult.game_numberUpdatedGameResult.date_timeUpdatedGameResult.end_timeUpdatedGameResult.game_typeUpdatedGameResult.locationUpdatedGameResult.team_idUpdatedGameResult.opposing_team_idUpdatedGameResult.season_idUpdatedGameResult.association_idUpdatedGameResult.league_idUpdatedGameResult.division_idUpdatedGameResult.opposing_divisionUpdatedGameResult.home_flagUpdatedGameResult.time_zone_nameUpdatedGameResult.time_zone_offsetUpdatedGameResult.scorekeeper_nameUpdatedGameResult.scorekeeper_phoneUpdatedGameResult.broadcast_providerUpdatedGameResult.model_configUpdatedGameResult.successUpdatedGameResult.idUpdatedGameResult.messageUpdatedGameResult.game_numberUpdatedGameResult.date_timeUpdatedGameResult.end_timeUpdatedGameResult.game_typeUpdatedGameResult.locationUpdatedGameResult.team_idUpdatedGameResult.opposing_team_idUpdatedGameResult.season_idUpdatedGameResult.association_idUpdatedGameResult.league_idUpdatedGameResult.division_idUpdatedGameResult.opposing_divisionUpdatedGameResult.home_flagUpdatedGameResult.time_zone_nameUpdatedGameResult.time_zone_offsetUpdatedGameResult.scorekeeper_nameUpdatedGameResult.scorekeeper_phoneUpdatedGameResult.broadcast_providerUpdatedGameResult.__init__()UpdatedGameResult.construct()UpdatedGameResult.copy()UpdatedGameResult.dict()UpdatedGameResult.from_orm()UpdatedGameResult.json()UpdatedGameResult.model_computed_fieldsUpdatedGameResult.model_construct()UpdatedGameResult.model_copy()UpdatedGameResult.model_dump()UpdatedGameResult.model_dump_json()UpdatedGameResult.model_extraUpdatedGameResult.model_fieldsUpdatedGameResult.model_fields_setUpdatedGameResult.model_json_schema()UpdatedGameResult.model_parametrized_name()UpdatedGameResult.model_post_init()UpdatedGameResult.model_rebuild()UpdatedGameResult.model_validate()UpdatedGameResult.model_validate_json()UpdatedGameResult.model_validate_strings()UpdatedGameResult.parse_file()UpdatedGameResult.parse_obj()UpdatedGameResult.parse_raw()UpdatedGameResult.schema()UpdatedGameResult.schema_json()UpdatedGameResult.update_forward_refs()UpdatedGameResult.validate()
- gamesheet_sdk.teams.schedule.query module
- gamesheet_sdk.teams.schedule.update module