File tree Expand file tree Collapse file tree 2 files changed +24
-0
lines changed Expand file tree Collapse file tree 2 files changed +24
-0
lines changed Original file line number Diff line number Diff line change @@ -111,6 +111,9 @@ def error_code(self):
111111 def error_message (self ):
112112 return self ._extended_operation .error_message
113113
114+ def __getattr__ (self , name ):
115+ return getattr (self ._extended_operation , name )
116+
114117 def done (self , retry = polling .DEFAULT_RETRY ):
115118 self ._refresh_and_update (retry )
116119 return self ._extended_operation .done
Original file line number Diff line number Diff line change @@ -37,6 +37,7 @@ class StatusCode(enum.Enum):
3737 status : StatusCode
3838 error_code : typing .Optional [int ] = None
3939 error_message : typing .Optional [str ] = None
40+ armor_class : typing .Optional [int ] = None
4041
4142 # Note: in generated clients, this property must be generated for each
4243 # extended operation message type.
@@ -180,3 +181,23 @@ def test_error():
180181
181182 with pytest .raises (exceptions .GoogleAPICallError ):
182183 ex_op .result ()
184+
185+
186+ def test_pass_through ():
187+ responses = [
188+ CustomOperation (
189+ name = TEST_OPERATION_NAME ,
190+ status = CustomOperation .StatusCode .PENDING ,
191+ armor_class = 10 ,
192+ ),
193+ CustomOperation (
194+ name = TEST_OPERATION_NAME ,
195+ status = CustomOperation .StatusCode .DONE ,
196+ armor_class = 20 ,
197+ ),
198+ ]
199+ ex_op , _ , _ = make_extended_operation (responses )
200+
201+ assert ex_op .armor_class == 10
202+ ex_op .result ()
203+ assert ex_op .armor_class == 20
You can’t perform that action at this time.
0 commit comments