pulumi-webflow 0.0.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,76 @@
1
+ # coding=utf-8
2
+ # *** WARNING: this file was generated by pulumi-language-python. ***
3
+ # *** Do not edit by hand unless you're certain you know what you are doing! ***
4
+
5
+ import builtins as _builtins
6
+ from . import _utilities
7
+ import typing
8
+ # Export this package's modules as members:
9
+ from .asset import *
10
+ from .asset_folder import *
11
+ from .collection import *
12
+ from .collection_field import *
13
+ from .collection_item import *
14
+ from .ecommerce_settings import *
15
+ from .get_authorized_user import *
16
+ from .get_token_info import *
17
+ from .page_content import *
18
+ from .page_custom_code import *
19
+ from .page_data import *
20
+ from .provider import *
21
+ from .redirect import *
22
+ from .registered_script import *
23
+ from .robots_txt import *
24
+ from .site import *
25
+ from .site_custom_code import *
26
+ from .user import *
27
+ from .webhook import *
28
+ from ._inputs import *
29
+ from . import outputs
30
+
31
+ # Make subpackages available:
32
+ if typing.TYPE_CHECKING:
33
+ import pulumi_webflow.config as __config
34
+ config = __config
35
+ else:
36
+ config = _utilities.lazy_import('pulumi_webflow.config')
37
+
38
+ _utilities.register(
39
+ resource_modules="""
40
+ [
41
+ {
42
+ "pkg": "webflow",
43
+ "mod": "index",
44
+ "fqn": "pulumi_webflow",
45
+ "classes": {
46
+ "webflow:index:Asset": "Asset",
47
+ "webflow:index:AssetFolder": "AssetFolder",
48
+ "webflow:index:Collection": "Collection",
49
+ "webflow:index:CollectionField": "CollectionField",
50
+ "webflow:index:CollectionItem": "CollectionItem",
51
+ "webflow:index:EcommerceSettings": "EcommerceSettings",
52
+ "webflow:index:PageContent": "PageContent",
53
+ "webflow:index:PageCustomCode": "PageCustomCode",
54
+ "webflow:index:PageData": "PageData",
55
+ "webflow:index:Redirect": "Redirect",
56
+ "webflow:index:RegisteredScript": "RegisteredScript",
57
+ "webflow:index:RobotsTxt": "RobotsTxt",
58
+ "webflow:index:Site": "Site",
59
+ "webflow:index:SiteCustomCode": "SiteCustomCode",
60
+ "webflow:index:User": "User",
61
+ "webflow:index:Webhook": "Webhook"
62
+ }
63
+ }
64
+ ]
65
+ """,
66
+ resource_packages="""
67
+ [
68
+ {
69
+ "pkg": "webflow",
70
+ "token": "pulumi:providers:webflow",
71
+ "fqn": "pulumi_webflow",
72
+ "class": "Provider"
73
+ }
74
+ ]
75
+ """
76
+ )
@@ -0,0 +1,254 @@
1
+ # coding=utf-8
2
+ # *** WARNING: this file was generated by pulumi-language-python. ***
3
+ # *** Do not edit by hand unless you're certain you know what you are doing! ***
4
+
5
+ import builtins as _builtins
6
+ import warnings
7
+ import sys
8
+ import pulumi
9
+ import pulumi.runtime
10
+ from typing import Any, Mapping, Optional, Sequence, Union, overload
11
+ if sys.version_info >= (3, 11):
12
+ from typing import NotRequired, TypedDict, TypeAlias
13
+ else:
14
+ from typing_extensions import NotRequired, TypedDict, TypeAlias
15
+ from . import _utilities
16
+
17
+ __all__ = [
18
+ 'CustomScriptArgsArgs',
19
+ 'CustomScriptArgsArgsDict',
20
+ 'NodeContentUpdateArgs',
21
+ 'NodeContentUpdateArgsDict',
22
+ 'PageCustomCodeScriptArgs',
23
+ 'PageCustomCodeScriptArgsDict',
24
+ ]
25
+
26
+ MYPY = False
27
+
28
+ if not MYPY:
29
+ class CustomScriptArgsArgsDict(TypedDict):
30
+ id: pulumi.Input[_builtins.str]
31
+ """
32
+ The unique identifier of the registered custom code script. The script must first be registered to the site using the RegisterScript resource. Examples: 'cms_slider', 'analytics', 'custom_widget'
33
+ """
34
+ location: pulumi.Input[_builtins.str]
35
+ """
36
+ The location where the script is placed on the page. Valid values: 'header' (placed in the <head> section), 'footer' (placed before </body>). Scripts in the header execute before page content loads, while footer scripts execute after the page has loaded.
37
+ """
38
+ version: pulumi.Input[_builtins.str]
39
+ """
40
+ The semantic version string for the registered script (e.g., '1.0.0', '0.1.2'). This version must exist for the registered script ID. When you update the version, a different version of the script will be applied.
41
+ """
42
+ attributes: NotRequired[pulumi.Input[Mapping[str, Any]]]
43
+ """
44
+ Optional developer-specified key/value pairs applied as HTML attributes to the script tag. Example: {'data-config': 'my-value'}. These attributes are passed directly to the script tag.
45
+ """
46
+ elif False:
47
+ CustomScriptArgsArgsDict: TypeAlias = Mapping[str, Any]
48
+
49
+ @pulumi.input_type
50
+ class CustomScriptArgsArgs:
51
+ def __init__(__self__, *,
52
+ id: pulumi.Input[_builtins.str],
53
+ location: pulumi.Input[_builtins.str],
54
+ version: pulumi.Input[_builtins.str],
55
+ attributes: Optional[pulumi.Input[Mapping[str, Any]]] = None):
56
+ """
57
+ :param pulumi.Input[_builtins.str] id: The unique identifier of the registered custom code script. The script must first be registered to the site using the RegisterScript resource. Examples: 'cms_slider', 'analytics', 'custom_widget'
58
+ :param pulumi.Input[_builtins.str] location: The location where the script is placed on the page. Valid values: 'header' (placed in the <head> section), 'footer' (placed before </body>). Scripts in the header execute before page content loads, while footer scripts execute after the page has loaded.
59
+ :param pulumi.Input[_builtins.str] version: The semantic version string for the registered script (e.g., '1.0.0', '0.1.2'). This version must exist for the registered script ID. When you update the version, a different version of the script will be applied.
60
+ :param pulumi.Input[Mapping[str, Any]] attributes: Optional developer-specified key/value pairs applied as HTML attributes to the script tag. Example: {'data-config': 'my-value'}. These attributes are passed directly to the script tag.
61
+ """
62
+ pulumi.set(__self__, "id", id)
63
+ pulumi.set(__self__, "location", location)
64
+ pulumi.set(__self__, "version", version)
65
+ if attributes is not None:
66
+ pulumi.set(__self__, "attributes", attributes)
67
+
68
+ @_builtins.property
69
+ @pulumi.getter
70
+ def id(self) -> pulumi.Input[_builtins.str]:
71
+ """
72
+ The unique identifier of the registered custom code script. The script must first be registered to the site using the RegisterScript resource. Examples: 'cms_slider', 'analytics', 'custom_widget'
73
+ """
74
+ return pulumi.get(self, "id")
75
+
76
+ @id.setter
77
+ def id(self, value: pulumi.Input[_builtins.str]):
78
+ pulumi.set(self, "id", value)
79
+
80
+ @_builtins.property
81
+ @pulumi.getter
82
+ def location(self) -> pulumi.Input[_builtins.str]:
83
+ """
84
+ The location where the script is placed on the page. Valid values: 'header' (placed in the <head> section), 'footer' (placed before </body>). Scripts in the header execute before page content loads, while footer scripts execute after the page has loaded.
85
+ """
86
+ return pulumi.get(self, "location")
87
+
88
+ @location.setter
89
+ def location(self, value: pulumi.Input[_builtins.str]):
90
+ pulumi.set(self, "location", value)
91
+
92
+ @_builtins.property
93
+ @pulumi.getter
94
+ def version(self) -> pulumi.Input[_builtins.str]:
95
+ """
96
+ The semantic version string for the registered script (e.g., '1.0.0', '0.1.2'). This version must exist for the registered script ID. When you update the version, a different version of the script will be applied.
97
+ """
98
+ return pulumi.get(self, "version")
99
+
100
+ @version.setter
101
+ def version(self, value: pulumi.Input[_builtins.str]):
102
+ pulumi.set(self, "version", value)
103
+
104
+ @_builtins.property
105
+ @pulumi.getter
106
+ def attributes(self) -> Optional[pulumi.Input[Mapping[str, Any]]]:
107
+ """
108
+ Optional developer-specified key/value pairs applied as HTML attributes to the script tag. Example: {'data-config': 'my-value'}. These attributes are passed directly to the script tag.
109
+ """
110
+ return pulumi.get(self, "attributes")
111
+
112
+ @attributes.setter
113
+ def attributes(self, value: Optional[pulumi.Input[Mapping[str, Any]]]):
114
+ pulumi.set(self, "attributes", value)
115
+
116
+
117
+ if not MYPY:
118
+ class NodeContentUpdateArgsDict(TypedDict):
119
+ node_id: pulumi.Input[_builtins.str]
120
+ """
121
+ The unique identifier for the DOM node to update. This ID comes from the page's DOM structure and must exist on the page. Retrieve node IDs using GET /pages/{page_id}/dom endpoint.
122
+ """
123
+ text: pulumi.Input[_builtins.str]
124
+ """
125
+ The new text content for the node. This will replace the existing text content in the specified node. Only applicable to text nodes or elements containing text.
126
+ """
127
+ elif False:
128
+ NodeContentUpdateArgsDict: TypeAlias = Mapping[str, Any]
129
+
130
+ @pulumi.input_type
131
+ class NodeContentUpdateArgs:
132
+ def __init__(__self__, *,
133
+ node_id: pulumi.Input[_builtins.str],
134
+ text: pulumi.Input[_builtins.str]):
135
+ """
136
+ :param pulumi.Input[_builtins.str] node_id: The unique identifier for the DOM node to update. This ID comes from the page's DOM structure and must exist on the page. Retrieve node IDs using GET /pages/{page_id}/dom endpoint.
137
+ :param pulumi.Input[_builtins.str] text: The new text content for the node. This will replace the existing text content in the specified node. Only applicable to text nodes or elements containing text.
138
+ """
139
+ pulumi.set(__self__, "node_id", node_id)
140
+ pulumi.set(__self__, "text", text)
141
+
142
+ @_builtins.property
143
+ @pulumi.getter(name="nodeId")
144
+ def node_id(self) -> pulumi.Input[_builtins.str]:
145
+ """
146
+ The unique identifier for the DOM node to update. This ID comes from the page's DOM structure and must exist on the page. Retrieve node IDs using GET /pages/{page_id}/dom endpoint.
147
+ """
148
+ return pulumi.get(self, "node_id")
149
+
150
+ @node_id.setter
151
+ def node_id(self, value: pulumi.Input[_builtins.str]):
152
+ pulumi.set(self, "node_id", value)
153
+
154
+ @_builtins.property
155
+ @pulumi.getter
156
+ def text(self) -> pulumi.Input[_builtins.str]:
157
+ """
158
+ The new text content for the node. This will replace the existing text content in the specified node. Only applicable to text nodes or elements containing text.
159
+ """
160
+ return pulumi.get(self, "text")
161
+
162
+ @text.setter
163
+ def text(self, value: pulumi.Input[_builtins.str]):
164
+ pulumi.set(self, "text", value)
165
+
166
+
167
+ if not MYPY:
168
+ class PageCustomCodeScriptArgsDict(TypedDict):
169
+ attributes: pulumi.Input[Mapping[str, Any]]
170
+ """
171
+ Optional developer-specified key/value pairs for script attributes. These attributes can be used by the script to customize its behavior on this page.
172
+ """
173
+ id: pulumi.Input[_builtins.str]
174
+ """
175
+ The unique identifier of a registered custom code script. This must be a script that was previously registered using the RegisteredScript resource. Script IDs are assigned by Webflow when the script is registered.
176
+ """
177
+ location: pulumi.Input[_builtins.str]
178
+ """
179
+ Where the script should be applied on the page. Must be either 'header' (loaded in page header) or 'footer' (loaded at end of page). Use 'header' for scripts that don't depend on DOM elements. Use 'footer' for scripts that need to run after DOM is fully loaded.
180
+ """
181
+ version: pulumi.Input[_builtins.str]
182
+ """
183
+ The semantic version string for the registered script (e.g., '1.0.0'). This version must match a registered version of the script. You can have multiple versions of the same script registered.
184
+ """
185
+ elif False:
186
+ PageCustomCodeScriptArgsDict: TypeAlias = Mapping[str, Any]
187
+
188
+ @pulumi.input_type
189
+ class PageCustomCodeScriptArgs:
190
+ def __init__(__self__, *,
191
+ attributes: pulumi.Input[Mapping[str, Any]],
192
+ id: pulumi.Input[_builtins.str],
193
+ location: pulumi.Input[_builtins.str],
194
+ version: pulumi.Input[_builtins.str]):
195
+ """
196
+ :param pulumi.Input[Mapping[str, Any]] attributes: Optional developer-specified key/value pairs for script attributes. These attributes can be used by the script to customize its behavior on this page.
197
+ :param pulumi.Input[_builtins.str] id: The unique identifier of a registered custom code script. This must be a script that was previously registered using the RegisteredScript resource. Script IDs are assigned by Webflow when the script is registered.
198
+ :param pulumi.Input[_builtins.str] location: Where the script should be applied on the page. Must be either 'header' (loaded in page header) or 'footer' (loaded at end of page). Use 'header' for scripts that don't depend on DOM elements. Use 'footer' for scripts that need to run after DOM is fully loaded.
199
+ :param pulumi.Input[_builtins.str] version: The semantic version string for the registered script (e.g., '1.0.0'). This version must match a registered version of the script. You can have multiple versions of the same script registered.
200
+ """
201
+ pulumi.set(__self__, "attributes", attributes)
202
+ pulumi.set(__self__, "id", id)
203
+ pulumi.set(__self__, "location", location)
204
+ pulumi.set(__self__, "version", version)
205
+
206
+ @_builtins.property
207
+ @pulumi.getter
208
+ def attributes(self) -> pulumi.Input[Mapping[str, Any]]:
209
+ """
210
+ Optional developer-specified key/value pairs for script attributes. These attributes can be used by the script to customize its behavior on this page.
211
+ """
212
+ return pulumi.get(self, "attributes")
213
+
214
+ @attributes.setter
215
+ def attributes(self, value: pulumi.Input[Mapping[str, Any]]):
216
+ pulumi.set(self, "attributes", value)
217
+
218
+ @_builtins.property
219
+ @pulumi.getter
220
+ def id(self) -> pulumi.Input[_builtins.str]:
221
+ """
222
+ The unique identifier of a registered custom code script. This must be a script that was previously registered using the RegisteredScript resource. Script IDs are assigned by Webflow when the script is registered.
223
+ """
224
+ return pulumi.get(self, "id")
225
+
226
+ @id.setter
227
+ def id(self, value: pulumi.Input[_builtins.str]):
228
+ pulumi.set(self, "id", value)
229
+
230
+ @_builtins.property
231
+ @pulumi.getter
232
+ def location(self) -> pulumi.Input[_builtins.str]:
233
+ """
234
+ Where the script should be applied on the page. Must be either 'header' (loaded in page header) or 'footer' (loaded at end of page). Use 'header' for scripts that don't depend on DOM elements. Use 'footer' for scripts that need to run after DOM is fully loaded.
235
+ """
236
+ return pulumi.get(self, "location")
237
+
238
+ @location.setter
239
+ def location(self, value: pulumi.Input[_builtins.str]):
240
+ pulumi.set(self, "location", value)
241
+
242
+ @_builtins.property
243
+ @pulumi.getter
244
+ def version(self) -> pulumi.Input[_builtins.str]:
245
+ """
246
+ The semantic version string for the registered script (e.g., '1.0.0'). This version must match a registered version of the script. You can have multiple versions of the same script registered.
247
+ """
248
+ return pulumi.get(self, "version")
249
+
250
+ @version.setter
251
+ def version(self, value: pulumi.Input[_builtins.str]):
252
+ pulumi.set(self, "version", value)
253
+
254
+
@@ -0,0 +1,331 @@
1
+ # coding=utf-8
2
+ # *** WARNING: this file was generated by pulumi-language-python. ***
3
+ # *** Do not edit by hand unless you're certain you know what you are doing! ***
4
+
5
+
6
+ import asyncio
7
+ import functools
8
+ import importlib.metadata
9
+ import importlib.util
10
+ import inspect
11
+ import json
12
+ import os
13
+ import sys
14
+ import typing
15
+ import warnings
16
+ import base64
17
+
18
+ import pulumi
19
+ import pulumi.runtime
20
+ from pulumi.runtime.sync_await import _sync_await
21
+ from pulumi.runtime.proto import resource_pb2
22
+
23
+ from semver import VersionInfo as SemverVersion
24
+ from parver import Version as PEP440Version
25
+
26
+ C = typing.TypeVar("C", bound=typing.Callable)
27
+
28
+
29
+ def get_env(*args):
30
+ for v in args:
31
+ value = os.getenv(v)
32
+ if value is not None:
33
+ return value
34
+ return None
35
+
36
+
37
+ def get_env_bool(*args):
38
+ str = get_env(*args)
39
+ if str is not None:
40
+ # NOTE: these values are taken from https://golang.org/src/strconv/atob.go?s=351:391#L1, which is what
41
+ # Terraform uses internally when parsing boolean values.
42
+ if str in ["1", "t", "T", "true", "TRUE", "True"]:
43
+ return True
44
+ if str in ["0", "f", "F", "false", "FALSE", "False"]:
45
+ return False
46
+ return None
47
+
48
+
49
+ def get_env_int(*args):
50
+ str = get_env(*args)
51
+ if str is not None:
52
+ try:
53
+ return int(str)
54
+ except:
55
+ return None
56
+ return None
57
+
58
+
59
+ def get_env_float(*args):
60
+ str = get_env(*args)
61
+ if str is not None:
62
+ try:
63
+ return float(str)
64
+ except:
65
+ return None
66
+ return None
67
+
68
+
69
+ def _get_semver_version():
70
+ # __name__ is set to the fully-qualified name of the current module, In our case, it will be
71
+ # <some module>._utilities. <some module> is the module we want to query the version for.
72
+ root_package, *rest = __name__.split('.')
73
+
74
+ # pkg_resources uses setuptools to inspect the set of installed packages. We use it here to ask
75
+ # for the currently installed version of the root package (i.e. us) and get its version.
76
+
77
+ # Unfortunately, PEP440 and semver differ slightly in incompatible ways. The Pulumi engine expects
78
+ # to receive a valid semver string when receiving requests from the language host, so it's our
79
+ # responsibility as the library to convert our own PEP440 version into a valid semver string.
80
+
81
+ pep440_version_string = importlib.metadata.version(root_package)
82
+ pep440_version = PEP440Version.parse(pep440_version_string)
83
+ (major, minor, patch) = pep440_version.release
84
+ prerelease = None
85
+ if pep440_version.pre_tag == 'a':
86
+ prerelease = f"alpha.{pep440_version.pre}"
87
+ elif pep440_version.pre_tag == 'b':
88
+ prerelease = f"beta.{pep440_version.pre}"
89
+ elif pep440_version.pre_tag == 'rc':
90
+ prerelease = f"rc.{pep440_version.pre}"
91
+ elif pep440_version.dev is not None:
92
+ # PEP440 has explicit support for dev builds, while semver encodes them as "prerelease" versions. To bridge
93
+ # between the two, we convert our dev build version into a prerelease tag. This matches what all of our other
94
+ # packages do when constructing their own semver string.
95
+ prerelease = f"dev.{pep440_version.dev}"
96
+ elif pep440_version.local is not None:
97
+ # PEP440 only allows a small set of prerelease tags, so when converting an arbitrary prerelease,
98
+ # PypiVersion in /pkg/codegen/python/utilities.go converts it to a local version. Therefore, we need to
99
+ # do the reverse conversion here and set the local version as the prerelease tag.
100
+ prerelease = pep440_version.local
101
+
102
+ return SemverVersion(major=major, minor=minor, patch=patch, prerelease=prerelease)
103
+
104
+
105
+ # Determine the version once and cache the value, which measurably improves program performance.
106
+ _version = _get_semver_version()
107
+ _version_str = str(_version)
108
+
109
+ def get_resource_opts_defaults() -> pulumi.ResourceOptions:
110
+ return pulumi.ResourceOptions(
111
+ version=get_version(),
112
+ plugin_download_url=get_plugin_download_url(),
113
+ )
114
+
115
+ def get_invoke_opts_defaults() -> pulumi.InvokeOptions:
116
+ return pulumi.InvokeOptions(
117
+ version=get_version(),
118
+ plugin_download_url=get_plugin_download_url(),
119
+ )
120
+
121
+ def get_resource_args_opts(resource_args_type, resource_options_type, *args, **kwargs):
122
+ """
123
+ Return the resource args and options given the *args and **kwargs of a resource's
124
+ __init__ method.
125
+ """
126
+
127
+ resource_args, opts = None, None
128
+
129
+ # If the first item is the resource args type, save it and remove it from the args list.
130
+ if args and isinstance(args[0], resource_args_type):
131
+ resource_args, args = args[0], args[1:]
132
+
133
+ # Now look at the first item in the args list again.
134
+ # If the first item is the resource options class, save it.
135
+ if args and isinstance(args[0], resource_options_type):
136
+ opts = args[0]
137
+
138
+ # If resource_args is None, see if "args" is in kwargs, and, if so, if it's typed as the
139
+ # the resource args type.
140
+ if resource_args is None:
141
+ a = kwargs.get("args")
142
+ if isinstance(a, resource_args_type):
143
+ resource_args = a
144
+
145
+ # If opts is None, look it up in kwargs.
146
+ if opts is None:
147
+ opts = kwargs.get("opts")
148
+
149
+ return resource_args, opts
150
+
151
+
152
+ # Temporary: just use pulumi._utils.lazy_import once everyone upgrades.
153
+ def lazy_import(fullname):
154
+
155
+ import pulumi._utils as u
156
+ f = getattr(u, 'lazy_import', None)
157
+ if f is None:
158
+ f = _lazy_import_temp
159
+
160
+ return f(fullname)
161
+
162
+
163
+ # Copied from pulumi._utils.lazy_import, see comments there.
164
+ def _lazy_import_temp(fullname):
165
+ m = sys.modules.get(fullname, None)
166
+ if m is not None:
167
+ return m
168
+
169
+ spec = importlib.util.find_spec(fullname)
170
+
171
+ m = sys.modules.get(fullname, None)
172
+ if m is not None:
173
+ return m
174
+
175
+ loader = importlib.util.LazyLoader(spec.loader)
176
+ spec.loader = loader
177
+ module = importlib.util.module_from_spec(spec)
178
+
179
+ m = sys.modules.get(fullname, None)
180
+ if m is not None:
181
+ return m
182
+
183
+ sys.modules[fullname] = module
184
+ loader.exec_module(module)
185
+ return module
186
+
187
+
188
+ class Package(pulumi.runtime.ResourcePackage):
189
+ def __init__(self, pkg_info):
190
+ super().__init__()
191
+ self.pkg_info = pkg_info
192
+
193
+ def version(self):
194
+ return _version
195
+
196
+ def construct_provider(self, name: str, typ: str, urn: str) -> pulumi.ProviderResource:
197
+ if typ != self.pkg_info['token']:
198
+ raise Exception(f"unknown provider type {typ}")
199
+ Provider = getattr(lazy_import(self.pkg_info['fqn']), self.pkg_info['class'])
200
+ return Provider(name, pulumi.ResourceOptions(urn=urn))
201
+
202
+
203
+ class Module(pulumi.runtime.ResourceModule):
204
+ def __init__(self, mod_info):
205
+ super().__init__()
206
+ self.mod_info = mod_info
207
+
208
+ def version(self):
209
+ return _version
210
+
211
+ def construct(self, name: str, typ: str, urn: str) -> pulumi.Resource:
212
+ class_name = self.mod_info['classes'].get(typ, None)
213
+
214
+ if class_name is None:
215
+ raise Exception(f"unknown resource type {typ}")
216
+
217
+ TheClass = getattr(lazy_import(self.mod_info['fqn']), class_name)
218
+ return TheClass(name, pulumi.ResourceOptions(urn=urn))
219
+
220
+
221
+ def register(resource_modules, resource_packages):
222
+ resource_modules = json.loads(resource_modules)
223
+ resource_packages = json.loads(resource_packages)
224
+
225
+ for pkg_info in resource_packages:
226
+ pulumi.runtime.register_resource_package(pkg_info['pkg'], Package(pkg_info))
227
+
228
+ for mod_info in resource_modules:
229
+ pulumi.runtime.register_resource_module(
230
+ mod_info['pkg'],
231
+ mod_info['mod'],
232
+ Module(mod_info))
233
+
234
+
235
+ _F = typing.TypeVar('_F', bound=typing.Callable[..., typing.Any])
236
+
237
+
238
+ def lift_output_func(func: typing.Any) -> typing.Callable[[_F], _F]:
239
+ """Decorator internally used on {fn}_output lifted function versions
240
+ to implement them automatically from the un-lifted function."""
241
+
242
+ func_sig = inspect.signature(func)
243
+
244
+ def lifted_func(*args, opts=None, **kwargs):
245
+ bound_args = func_sig.bind(*args, **kwargs)
246
+ # Convert tuple to list, see pulumi/pulumi#8172
247
+ args_list = list(bound_args.args)
248
+ return pulumi.Output.from_input({
249
+ 'args': args_list,
250
+ 'kwargs': bound_args.kwargs
251
+ }).apply(lambda resolved_args: func(*resolved_args['args'],
252
+ opts=opts,
253
+ **resolved_args['kwargs']))
254
+
255
+ return (lambda _: lifted_func)
256
+
257
+
258
+ def call_plain(
259
+ tok: str,
260
+ props: pulumi.Inputs,
261
+ res: typing.Optional[pulumi.Resource] = None,
262
+ typ: typing.Optional[type] = None,
263
+ ) -> typing.Any:
264
+ """
265
+ Wraps pulumi.runtime.plain to force the output and return it plainly.
266
+ """
267
+
268
+ output = pulumi.runtime.call(tok, props, res, typ)
269
+
270
+ # Ingoring deps silently. They are typically non-empty, r.f() calls include r as a dependency.
271
+ result, known, secret, _ = _sync_await(asyncio.create_task(_await_output(output)))
272
+
273
+ problem = None
274
+ if not known:
275
+ problem = ' an unknown value'
276
+ elif secret:
277
+ problem = ' a secret value'
278
+
279
+ if problem:
280
+ raise AssertionError(
281
+ f"Plain resource method '{tok}' incorrectly returned {problem}. "
282
+ + "This is an error in the provider, please report this to the provider developer."
283
+ )
284
+
285
+ return result
286
+
287
+
288
+ async def _await_output(o: pulumi.Output[typing.Any]) -> typing.Tuple[object, bool, bool, set]:
289
+ return (
290
+ await o._future,
291
+ await o._is_known,
292
+ await o._is_secret,
293
+ await o._resources,
294
+ )
295
+
296
+
297
+ # This is included to provide an upgrade path for users who are using a version
298
+ # of the Pulumi SDK (<3.121.0) that does not include the `deprecated` decorator.
299
+ def deprecated(message: str) -> typing.Callable[[C], C]:
300
+ """
301
+ Decorator to indicate a function is deprecated.
302
+
303
+ As well as inserting appropriate statements to indicate that the function is
304
+ deprecated, this decorator also tags the function with a special attribute
305
+ so that Pulumi code can detect that it is deprecated and react appropriately
306
+ in certain situations.
307
+
308
+ message is the deprecation message that should be printed if the function is called.
309
+ """
310
+
311
+ def decorator(fn: C) -> C:
312
+ if not callable(fn):
313
+ raise TypeError("Expected fn to be callable")
314
+
315
+ @functools.wraps(fn)
316
+ def deprecated_fn(*args, **kwargs):
317
+ warnings.warn(message)
318
+ pulumi.warn(f"{fn.__name__} is deprecated: {message}")
319
+
320
+ return fn(*args, **kwargs)
321
+
322
+ deprecated_fn.__dict__["_pulumi_deprecated_callable"] = fn
323
+ return typing.cast(C, deprecated_fn)
324
+
325
+ return decorator
326
+
327
+ def get_plugin_download_url():
328
+ return None
329
+
330
+ def get_version():
331
+ return _version_str