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.

host is the API base URL and access_token is the Pulumi access token sent as Authorization: token <token>. A single ApiClient is cached on api_client so the generated *Api classes 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 declare DISCRIMINATOR (the wire field name), __DISCRIMINATOR_VALUE__ (this class’s discriminator value), and the fixup_prototype / _ensure_discriminator_hierarchy helpers.

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 response into an instance of response_type.

response_type may 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 *Api methods for operations whose response declares response headers.