python-modelslisted
Install: claude install-skill MuHamza30/paypal-api-plugin
# Working with models in an APIMatic Python SDK
Most request/response data are plain Python objects under
`paypalserversdk/models/` (covered in `python-calling-endpoints`). This skill covers the **non-obvious
model shapes** that trip integrations up. The patterns are generic across APIMatic Python SDKs; take the
real names from your SDK source.
> `doc/models/*.md` carries one page per model — field table, types, and a **Default** column. Read it
> alongside the class body; `doc/models/containers/` covers union types.
## Anatomy of a generated model
Each model class carries two or three class-level tables that tell you everything about its wire
behaviour — `_nullables` is generated only for models that have a nullable attribute:
- `_names` — maps the Python attribute name to the **API property name**. When the two differ (`mtype`
for a property called `type`, `person_type` for `personType`), this is the mapping that explains it.
- `_optionals` — the attributes that may be omitted.
Plus a `from_dictionary(dictionary)` classmethod, which is how the SDK deserializes responses. You
rarely call it directly, but it is the definitive answer to how a given field is parsed.
## Optional attributes: absent, not `None`
An attribute in `_optionals` defaults to `APIHelper.SKIP`, and the constructor **only assigns it when
you pass something else**. So on both the request and the response side:
```python
model = {Model}({required_attr}=1) # {optional_attr} never assigned — un