In the new version, types have been added. For example:
def create_namespaced_secret(self, namespace: str, body: V1Secret, ...) -> Awaitable[V1Secret]:
...
Previously, you could pass either a V1Secret or a dict[str, Any] to this function. Now the type system complains when you try to pass a dict.
The thing is, I don't know in advance what manifest dict I'll receive (it can have different sets of fields), so I can't explicitly construct a V1Secret.
What's the right approach now?
create_namespaced_secret(namespace, cast(V1Secret, dict_manifest))
Or maybe?
create_namespaced_secret(namespace, api_client.__deserialize_model(dict_manifest, V1Secret))
In the new version, types have been added. For example:
Previously, you could pass either a
V1Secretor adict[str, Any]to this function. Now the type system complains when you try to pass a dict.The thing is, I don't know in advance what manifest dict I'll receive (it can have different sets of fields), so I can't explicitly construct a V1Secret.
What's the right approach now?
Or maybe?