wxc_sdk.base module
- wxc_sdk.base.webex_id_to_uuid(webex_id: str | None) str | None[source]
Convert a webex id as used by the public APIs to a UUID
- Parameters:
webex_id (str) – base 64 encoded id as used by public APIs
- Returns:
ID in uuid format
- wxc_sdk.base.to_camel(s: str) str[source]
Convert snake case variable name to camel case log_id -> logId
- Parameters:
s – snake case variable name
- Returns:
Camel case name
- class wxc_sdk.base.ApiModel(**extra_data: Any)[source]
Bases:
BaseModelBase for all models used by the APIs
- model_dump_json(exclude_none: bool = True, by_alias: bool = True, **kwargs: Any) str[source]
- !!! 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 – Indentation to use in the JSON output. If None is passed, the output will be compact.
ensure_ascii – 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 – Field(s) to include in the JSON output.
exclude – Field(s) to exclude from the JSON output.
context – Additional context to pass to the serializer.
by_alias – Whether to serialize using field aliases.
exclude_unset – Whether to exclude fields that have not been explicitly set.
exclude_defaults – Whether to exclude fields that are set to their default value.
exclude_none – Whether to exclude fields that have a value of None.
exclude_computed_fields – 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 – If True, dumped values should be valid as input for non-idempotent types such as Json[T].
warnings – How to handle serialization errors. False/”none” ignores them, True/”warn” logs errors, “error” raises a [PydanticSerializationError][pydantic_core.PydanticSerializationError].
fallback – A function to call when an unknown value is encountered. If not provided, a [PydanticSerializationError][pydantic_core.PydanticSerializationError] error is raised.
serialize_as_any – Whether to serialize fields with duck-typing serialization behavior.
polymorphic_serialization – Whether to use model and dataclass polymorphic serialization for this call.
- Returns:
A JSON string representation of the model.
- classmethod model_validate(obj: Any, **kwargs: Any) Self[source]
Validate a pydantic model instance.
- Parameters:
obj – The object to validate.
strict – Whether to enforce types strictly.
extra – Whether to ignore, allow, or forbid extra data during model validation. See the [extra configuration value][pydantic.ConfigDict.extra] for details.
from_attributes – Whether to extract data from object attributes.
context – Additional context to pass to the validator.
by_alias – Whether to use the field’s alias when validating against the provided input data.
by_name – 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.
- class wxc_sdk.base.CodeAndReason(*, code: str, reason: str, **extra_data: Any)[source]
Bases:
ApiModel- code: str
- reason: str
- class wxc_sdk.base.ApiModelWithErrors(*, errors: dict[str, CodeAndReason] | None = None, **extra_data: Any)[source]
Bases:
ApiModel- errors: dict[str, CodeAndReason] | None
- wxc_sdk.base.plus1(v: str | None) str | None[source]
Convert 10D number to +E.164. Can be used as validator :param v: :return:
- wxc_sdk.base.dt_iso_str(dt: datetime, with_msec: bool = True) str[source]
ISO format datetime as used by Webex API (no time zone, milliseconds)
- Parameters:
dt
with_msec
- Returns: