(cls, prop: Property)
| 1077 | |
| 1078 | @classmethod |
| 1079 | def create_init_attr(cls, prop: Property) -> cst.SimpleStatementLine: |
| 1080 | # we need to make the 'headers' attribute truly private, |
| 1081 | # otherwise it conflicts with GithubObject._headers |
| 1082 | attr_name = f"__{prop.name}" if prop.name == "headers" else f"_{prop.name}" |
| 1083 | return cst.SimpleStatementLine( |
| 1084 | [ |
| 1085 | cst.AnnAssign( |
| 1086 | target=cls.create_attribute(["self", attr_name]), |
| 1087 | annotation=cst.Annotation( |
| 1088 | annotation=cst.Subscript( |
| 1089 | value=cst.Name("Attribute"), |
| 1090 | slice=[ |
| 1091 | cst.SubscriptElement( |
| 1092 | slice=cst.Index(cls.create_type(prop.data_type, short_class_name=True)) |
| 1093 | ) |
| 1094 | ], |
| 1095 | ) |
| 1096 | ), |
| 1097 | value=cst.Name("NotSet"), |
| 1098 | ) |
| 1099 | ] |
| 1100 | ) |
| 1101 | |
| 1102 | @classmethod |
| 1103 | def make_attribute(cls, prop: Property) -> cst.Call: |
no test coverage detected