@@ -104,7 +104,7 @@ def __init__(self, *args, **kwargs):
104104 # Allow setting identifiers as positional arguments in the order
105105 # in which they were defined in the ResourceJSON.
106106 for i , value in enumerate (args ):
107- setattr (self , '_' + self .meta .identifiers [i ], value )
107+ setattr (self , f"_ { self .meta .identifiers [i ]} " , value )
108108
109109 # Allow setting identifiers via keyword arguments. Here we need
110110 # extra logic to ignore other keyword arguments like ``client``.
@@ -115,23 +115,19 @@ def __init__(self, *args, **kwargs):
115115 if name not in self .meta .identifiers :
116116 raise ValueError (f'Unknown keyword argument: { name } ' )
117117
118- setattr (self , '_' + name , value )
118+ setattr (self , f"_ { name } " , value )
119119
120120 # Validate that all identifiers have been set.
121121 for identifier in self .meta .identifiers :
122122 if getattr (self , identifier ) is None :
123123 raise ValueError (f'Required parameter { identifier } not set' )
124124
125125 def __repr__ (self ):
126- identifiers = []
127- for identifier in self .meta .identifiers :
128- identifiers .append (
129- f'{ identifier } ={ repr (getattr (self , identifier ))} '
130- )
131- return "{}({})" .format (
132- self .__class__ .__name__ ,
133- ', ' .join (identifiers ),
134- )
126+ identifiers = [
127+ f'{ identifier } ={ repr (getattr (self , identifier ))} '
128+ for identifier in self .meta .identifiers
129+ ]
130+ return f"{ self .__class__ .__name__ } ({ ', ' .join (identifiers )} )"
135131
136132 def __eq__ (self , other ):
137133 # Should be instances of the same resource class
0 commit comments