pulumi_cloud_sdk
Pulumi Cloud Python SDK (in-repo sample).
The models and apis subpackages are generated by
pulumi-codegen generate python (make openapi_python). The top-level
runtime modules (_support, configuration, api_client) are
hand-written. See README.md.
- class pulumi_cloud_sdk.Configuration
Holds the connection settings shared by the generated API classes.
hostis the API base URL andaccess_tokenis the Pulumi access token sent asAuthorization: token <token>. A singleApiClientis cached onapi_clientso the generated*Apiclasses can share one HTTP client.
- class pulumi_cloud_sdk.PulumiAutoModelEncoder
Base class for every generated model.
Subclasses declare
__swagger_types__(attribute name -> type string) and__attribute_map__(attribute name -> wire JSON key). Polymorphic subclasses additionally declareDISCRIMINATOR(the wire field name),__DISCRIMINATOR_VALUE__(this class’s discriminator value), and thefixup_prototype/_ensure_discriminator_hierarchyhelpers.
- class pulumi_cloud_sdk.PulumiModelEncoder
Generic model encoder. Handles JSON encoding/decoding of generated models, driven by their
__swagger_types__/__attribute_map__metadata, with a per-(class, annotation) cache of compiled serialize/deserialize callbacks.- deserialize(response: Any, response_type: Any, /) Any
Deserialize
responseinto an instance ofresponse_type.response_typemay be a class or a type-name string (e.g. ‘Stack’, ‘list[Stack]’, ‘dict[str, Stack]’).
- find_first_difference(obj1: Any, obj2: Any, /) str | None
Compares two objects, making sure they are identical at a deep level.
- sanitize_for_serialization(obj: Any, /, *, type_annotation: str = None, keep_raw_values: bool = False, unwrap_enums: bool = False) Any
Build a JSON-ready object.
If obj is None, return None. Primitives pass through; datetime/date become ISO strings; lists/sets/tuples/dicts are sanitized element-wise; a model is converted to its wire-keyed properties dict.
- class pulumi_cloud_sdk.ResponseWithHeaders(response: R, headers: H)
Pairs a deserialized response body with typed response headers, mirroring
apitype.ResponseWithHeaders[R, H](Go) /ResponseWithHeaders<R, H>(TypeScript). Returned by generated*Apimethods for operations whose response declares response headers.