github.com/myhau/pulumi/pkg/v3@v3.70.2-0.20221116134521-f2775972e587/codegen/testing/test/testdata/hyphenated-symbols/python/pulumi_repro/outputs.py (about) 1 # coding=utf-8 2 # *** WARNING: this file was generated by test. *** 3 # *** Do not edit by hand unless you're certain you know what you are doing! *** 4 5 import copy 6 import warnings 7 import pulumi 8 import pulumi.runtime 9 from typing import Any, Mapping, Optional, Sequence, Union, overload 10 from . import _utilities 11 12 __all__ = [ 13 'Bar', 14 ] 15 16 @pulumi.output_type 17 class Bar(dict): 18 @staticmethod 19 def __key_warning(key: str): 20 suggest = None 21 if key == "has-a-hyphen": 22 suggest = "has_a_hyphen" 23 24 if suggest: 25 pulumi.log.warn(f"Key '{key}' not found in Bar. Access the value via the '{suggest}' property getter instead.") 26 27 def __getitem__(self, key: str) -> Any: 28 Bar.__key_warning(key) 29 return super().__getitem__(key) 30 31 def get(self, key: str, default = None) -> Any: 32 Bar.__key_warning(key) 33 return super().get(key, default) 34 35 def __init__(__self__, *, 36 has_a_hyphen: Optional[str] = None): 37 if has_a_hyphen is not None: 38 pulumi.set(__self__, "has_a_hyphen", has_a_hyphen) 39 40 @property 41 @pulumi.getter(name="has-a-hyphen") 42 def has_a_hyphen(self) -> Optional[str]: 43 return pulumi.get(self, "has_a_hyphen") 44 45