File tree 2 files changed +24
-0
lines changed
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):
111
111
def error_message (self ):
112
112
return self ._extended_operation .error_message
113
113
114
+ def __getattr__ (self , name ):
115
+ return getattr (self ._extended_operation , name )
116
+
114
117
def done (self , retry = polling .DEFAULT_RETRY ):
115
118
self ._refresh_and_update (retry )
116
119
return self ._extended_operation .done
Original file line number Diff line number Diff line change @@ -37,6 +37,7 @@ class StatusCode(enum.Enum):
37
37
status : StatusCode
38
38
error_code : typing .Optional [int ] = None
39
39
error_message : typing .Optional [str ] = None
40
+ armor_class : typing .Optional [int ] = None
40
41
41
42
# Note: in generated clients, this property must be generated for each
42
43
# extended operation message type.
@@ -180,3 +181,23 @@ def test_error():
180
181
181
182
with pytest .raises (exceptions .GoogleAPICallError ):
182
183
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