moovio_sdk 0.14.0__py3-none-any.whl → 0.14.1__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
moovio_sdk/wallets.py CHANGED
@@ -7,14 +7,284 @@ from moovio_sdk.models import components, errors, operations
7
7
  from moovio_sdk.types import OptionalNullable, UNSET
8
8
  from moovio_sdk.utils import get_security_from_env
9
9
  from moovio_sdk.utils.unmarshal_json_response import unmarshal_json_response
10
- from typing import List, Mapping, Optional
10
+ from typing import Any, Dict, List, Mapping, Optional
11
11
 
12
12
 
13
13
  class Wallets(BaseSDK):
14
+ def create(
15
+ self,
16
+ *,
17
+ account_id: str,
18
+ name: str,
19
+ description: Optional[str] = None,
20
+ metadata: Optional[Dict[str, str]] = None,
21
+ retries: OptionalNullable[utils.RetryConfig] = UNSET,
22
+ server_url: Optional[str] = None,
23
+ timeout_ms: Optional[int] = None,
24
+ http_headers: Optional[Mapping[str, str]] = None,
25
+ ) -> operations.CreateWalletResponse:
26
+ r"""Create a new wallet for an account. You can specify optional attributes such as a display name and description to specify the intended use of the wallet. This will generate a new moov-wallet payment method.
27
+
28
+ Read our [Moov wallets guide](https://docs.moov.io/guides/sources/wallets/) to learn more.
29
+
30
+ To access this endpoint using an [access token](https://docs.moov.io/api/authentication/access-tokens/)
31
+ you'll need to specify the `/accounts/{accountID}/wallets.write` scope.
32
+
33
+ :param account_id: The Moov account ID the wallet belongs to.
34
+ :param name: Name of the wallet.
35
+ :param description: Description of the wallet.
36
+ :param metadata: Free-form key-value pair list. Useful for storing information that is not captured elsewhere.
37
+ :param retries: Override the default retry configuration for this method
38
+ :param server_url: Override the default server URL for this method
39
+ :param timeout_ms: Override the default request timeout configuration for this method in milliseconds
40
+ :param http_headers: Additional headers to set or replace on requests.
41
+ """
42
+ base_url = None
43
+ url_variables = None
44
+ if timeout_ms is None:
45
+ timeout_ms = self.sdk_configuration.timeout_ms
46
+
47
+ if server_url is not None:
48
+ base_url = server_url
49
+ else:
50
+ base_url = self._get_url(base_url, url_variables)
51
+
52
+ request = operations.CreateWalletRequest(
53
+ account_id=account_id,
54
+ create_wallet=components.CreateWallet(
55
+ name=name,
56
+ description=description,
57
+ metadata=metadata,
58
+ ),
59
+ )
60
+
61
+ req = self._build_request(
62
+ method="POST",
63
+ path="/accounts/{accountID}/wallets",
64
+ base_url=base_url,
65
+ url_variables=url_variables,
66
+ request=request,
67
+ request_body_required=True,
68
+ request_has_path_params=True,
69
+ request_has_query_params=True,
70
+ user_agent_header="user-agent",
71
+ accept_header_value="application/json",
72
+ http_headers=http_headers,
73
+ _globals=operations.CreateWalletGlobals(
74
+ x_moov_version=self.sdk_configuration.globals.x_moov_version,
75
+ ),
76
+ security=self.sdk_configuration.security,
77
+ get_serialized_body=lambda: utils.serialize_request_body(
78
+ request.create_wallet, False, False, "json", components.CreateWallet
79
+ ),
80
+ timeout_ms=timeout_ms,
81
+ )
82
+
83
+ if retries == UNSET:
84
+ if self.sdk_configuration.retry_config is not UNSET:
85
+ retries = self.sdk_configuration.retry_config
86
+
87
+ retry_config = None
88
+ if isinstance(retries, utils.RetryConfig):
89
+ retry_config = (retries, ["429", "500", "502", "503", "504"])
90
+
91
+ http_res = self.do_request(
92
+ hook_ctx=HookContext(
93
+ config=self.sdk_configuration,
94
+ base_url=base_url or "",
95
+ operation_id="createWallet",
96
+ oauth2_scopes=[],
97
+ security_source=get_security_from_env(
98
+ self.sdk_configuration.security, components.Security
99
+ ),
100
+ ),
101
+ request=req,
102
+ error_status_codes=[
103
+ "400",
104
+ "401",
105
+ "403",
106
+ "404",
107
+ "409",
108
+ "422",
109
+ "429",
110
+ "4XX",
111
+ "500",
112
+ "504",
113
+ "5XX",
114
+ ],
115
+ retry_config=retry_config,
116
+ )
117
+
118
+ response_data: Any = None
119
+ if utils.match_response(http_res, "200", "application/json"):
120
+ return operations.CreateWalletResponse(
121
+ result=unmarshal_json_response(components.Wallet, http_res),
122
+ headers=utils.get_response_headers(http_res.headers),
123
+ )
124
+ if utils.match_response(http_res, ["400", "409"], "application/json"):
125
+ response_data = unmarshal_json_response(errors.GenericErrorData, http_res)
126
+ raise errors.GenericError(response_data, http_res)
127
+ if utils.match_response(http_res, "422", "application/json"):
128
+ response_data = unmarshal_json_response(
129
+ errors.CreateWalletErrorData, http_res
130
+ )
131
+ raise errors.CreateWalletError(response_data, http_res)
132
+ if utils.match_response(http_res, ["401", "403", "404", "429"], "*"):
133
+ http_res_text = utils.stream_to_text(http_res)
134
+ raise errors.APIError("API error occurred", http_res, http_res_text)
135
+ if utils.match_response(http_res, ["500", "504"], "*"):
136
+ http_res_text = utils.stream_to_text(http_res)
137
+ raise errors.APIError("API error occurred", http_res, http_res_text)
138
+ if utils.match_response(http_res, "4XX", "*"):
139
+ http_res_text = utils.stream_to_text(http_res)
140
+ raise errors.APIError("API error occurred", http_res, http_res_text)
141
+ if utils.match_response(http_res, "5XX", "*"):
142
+ http_res_text = utils.stream_to_text(http_res)
143
+ raise errors.APIError("API error occurred", http_res, http_res_text)
144
+
145
+ raise errors.APIError("Unexpected response received", http_res)
146
+
147
+ async def create_async(
148
+ self,
149
+ *,
150
+ account_id: str,
151
+ name: str,
152
+ description: Optional[str] = None,
153
+ metadata: Optional[Dict[str, str]] = None,
154
+ retries: OptionalNullable[utils.RetryConfig] = UNSET,
155
+ server_url: Optional[str] = None,
156
+ timeout_ms: Optional[int] = None,
157
+ http_headers: Optional[Mapping[str, str]] = None,
158
+ ) -> operations.CreateWalletResponse:
159
+ r"""Create a new wallet for an account. You can specify optional attributes such as a display name and description to specify the intended use of the wallet. This will generate a new moov-wallet payment method.
160
+
161
+ Read our [Moov wallets guide](https://docs.moov.io/guides/sources/wallets/) to learn more.
162
+
163
+ To access this endpoint using an [access token](https://docs.moov.io/api/authentication/access-tokens/)
164
+ you'll need to specify the `/accounts/{accountID}/wallets.write` scope.
165
+
166
+ :param account_id: The Moov account ID the wallet belongs to.
167
+ :param name: Name of the wallet.
168
+ :param description: Description of the wallet.
169
+ :param metadata: Free-form key-value pair list. Useful for storing information that is not captured elsewhere.
170
+ :param retries: Override the default retry configuration for this method
171
+ :param server_url: Override the default server URL for this method
172
+ :param timeout_ms: Override the default request timeout configuration for this method in milliseconds
173
+ :param http_headers: Additional headers to set or replace on requests.
174
+ """
175
+ base_url = None
176
+ url_variables = None
177
+ if timeout_ms is None:
178
+ timeout_ms = self.sdk_configuration.timeout_ms
179
+
180
+ if server_url is not None:
181
+ base_url = server_url
182
+ else:
183
+ base_url = self._get_url(base_url, url_variables)
184
+
185
+ request = operations.CreateWalletRequest(
186
+ account_id=account_id,
187
+ create_wallet=components.CreateWallet(
188
+ name=name,
189
+ description=description,
190
+ metadata=metadata,
191
+ ),
192
+ )
193
+
194
+ req = self._build_request_async(
195
+ method="POST",
196
+ path="/accounts/{accountID}/wallets",
197
+ base_url=base_url,
198
+ url_variables=url_variables,
199
+ request=request,
200
+ request_body_required=True,
201
+ request_has_path_params=True,
202
+ request_has_query_params=True,
203
+ user_agent_header="user-agent",
204
+ accept_header_value="application/json",
205
+ http_headers=http_headers,
206
+ _globals=operations.CreateWalletGlobals(
207
+ x_moov_version=self.sdk_configuration.globals.x_moov_version,
208
+ ),
209
+ security=self.sdk_configuration.security,
210
+ get_serialized_body=lambda: utils.serialize_request_body(
211
+ request.create_wallet, False, False, "json", components.CreateWallet
212
+ ),
213
+ timeout_ms=timeout_ms,
214
+ )
215
+
216
+ if retries == UNSET:
217
+ if self.sdk_configuration.retry_config is not UNSET:
218
+ retries = self.sdk_configuration.retry_config
219
+
220
+ retry_config = None
221
+ if isinstance(retries, utils.RetryConfig):
222
+ retry_config = (retries, ["429", "500", "502", "503", "504"])
223
+
224
+ http_res = await self.do_request_async(
225
+ hook_ctx=HookContext(
226
+ config=self.sdk_configuration,
227
+ base_url=base_url or "",
228
+ operation_id="createWallet",
229
+ oauth2_scopes=[],
230
+ security_source=get_security_from_env(
231
+ self.sdk_configuration.security, components.Security
232
+ ),
233
+ ),
234
+ request=req,
235
+ error_status_codes=[
236
+ "400",
237
+ "401",
238
+ "403",
239
+ "404",
240
+ "409",
241
+ "422",
242
+ "429",
243
+ "4XX",
244
+ "500",
245
+ "504",
246
+ "5XX",
247
+ ],
248
+ retry_config=retry_config,
249
+ )
250
+
251
+ response_data: Any = None
252
+ if utils.match_response(http_res, "200", "application/json"):
253
+ return operations.CreateWalletResponse(
254
+ result=unmarshal_json_response(components.Wallet, http_res),
255
+ headers=utils.get_response_headers(http_res.headers),
256
+ )
257
+ if utils.match_response(http_res, ["400", "409"], "application/json"):
258
+ response_data = unmarshal_json_response(errors.GenericErrorData, http_res)
259
+ raise errors.GenericError(response_data, http_res)
260
+ if utils.match_response(http_res, "422", "application/json"):
261
+ response_data = unmarshal_json_response(
262
+ errors.CreateWalletErrorData, http_res
263
+ )
264
+ raise errors.CreateWalletError(response_data, http_res)
265
+ if utils.match_response(http_res, ["401", "403", "404", "429"], "*"):
266
+ http_res_text = await utils.stream_to_text_async(http_res)
267
+ raise errors.APIError("API error occurred", http_res, http_res_text)
268
+ if utils.match_response(http_res, ["500", "504"], "*"):
269
+ http_res_text = await utils.stream_to_text_async(http_res)
270
+ raise errors.APIError("API error occurred", http_res, http_res_text)
271
+ if utils.match_response(http_res, "4XX", "*"):
272
+ http_res_text = await utils.stream_to_text_async(http_res)
273
+ raise errors.APIError("API error occurred", http_res, http_res_text)
274
+ if utils.match_response(http_res, "5XX", "*"):
275
+ http_res_text = await utils.stream_to_text_async(http_res)
276
+ raise errors.APIError("API error occurred", http_res, http_res_text)
277
+
278
+ raise errors.APIError("Unexpected response received", http_res)
279
+
14
280
  def list(
15
281
  self,
16
282
  *,
17
283
  account_id: str,
284
+ status: Optional[components.WalletStatus] = None,
285
+ wallet_type: Optional[components.WalletType] = None,
286
+ skip: Optional[int] = None,
287
+ count: Optional[int] = None,
18
288
  retries: OptionalNullable[utils.RetryConfig] = UNSET,
19
289
  server_url: Optional[str] = None,
20
290
  timeout_ms: Optional[int] = None,
@@ -28,6 +298,10 @@ class Wallets(BaseSDK):
28
298
  you'll need to specify the `/accounts/{accountID}/wallets.read` scope.
29
299
 
30
300
  :param account_id:
301
+ :param status: Optional parameter for filtering wallets by status.
302
+ :param wallet_type: Optional parameter for filtering wallets by type.
303
+ :param skip:
304
+ :param count:
31
305
  :param retries: Override the default retry configuration for this method
32
306
  :param server_url: Override the default server URL for this method
33
307
  :param timeout_ms: Override the default request timeout configuration for this method in milliseconds
@@ -44,6 +318,10 @@ class Wallets(BaseSDK):
44
318
  base_url = self._get_url(base_url, url_variables)
45
319
 
46
320
  request = operations.ListWalletsRequest(
321
+ status=status,
322
+ wallet_type=wallet_type,
323
+ skip=skip,
324
+ count=count,
47
325
  account_id=account_id,
48
326
  )
49
327
 
@@ -113,6 +391,10 @@ class Wallets(BaseSDK):
113
391
  self,
114
392
  *,
115
393
  account_id: str,
394
+ status: Optional[components.WalletStatus] = None,
395
+ wallet_type: Optional[components.WalletType] = None,
396
+ skip: Optional[int] = None,
397
+ count: Optional[int] = None,
116
398
  retries: OptionalNullable[utils.RetryConfig] = UNSET,
117
399
  server_url: Optional[str] = None,
118
400
  timeout_ms: Optional[int] = None,
@@ -126,6 +408,10 @@ class Wallets(BaseSDK):
126
408
  you'll need to specify the `/accounts/{accountID}/wallets.read` scope.
127
409
 
128
410
  :param account_id:
411
+ :param status: Optional parameter for filtering wallets by status.
412
+ :param wallet_type: Optional parameter for filtering wallets by type.
413
+ :param skip:
414
+ :param count:
129
415
  :param retries: Override the default retry configuration for this method
130
416
  :param server_url: Override the default server URL for this method
131
417
  :param timeout_ms: Override the default request timeout configuration for this method in milliseconds
@@ -142,6 +428,10 @@ class Wallets(BaseSDK):
142
428
  base_url = self._get_url(base_url, url_variables)
143
429
 
144
430
  request = operations.ListWalletsRequest(
431
+ status=status,
432
+ wallet_type=wallet_type,
433
+ skip=skip,
434
+ count=count,
145
435
  account_id=account_id,
146
436
  )
147
437
 
@@ -408,3 +698,281 @@ class Wallets(BaseSDK):
408
698
  raise errors.APIError("API error occurred", http_res, http_res_text)
409
699
 
410
700
  raise errors.APIError("Unexpected response received", http_res)
701
+
702
+ def update(
703
+ self,
704
+ *,
705
+ wallet_id: str,
706
+ account_id: str,
707
+ name: Optional[str] = None,
708
+ status: Optional[components.WalletStatus] = None,
709
+ description: Optional[str] = None,
710
+ metadata: Optional[Dict[str, str]] = None,
711
+ retries: OptionalNullable[utils.RetryConfig] = UNSET,
712
+ server_url: Optional[str] = None,
713
+ timeout_ms: Optional[int] = None,
714
+ http_headers: Optional[Mapping[str, str]] = None,
715
+ ) -> operations.UpdateWalletResponse:
716
+ r"""Update properties of an existing wallet such as name, description, status, or metadata.
717
+
718
+ Read our [Moov wallets guide](https://docs.moov.io/guides/sources/wallets/) to learn more.
719
+
720
+ To access this endpoint using an [access token](https://docs.moov.io/api/authentication/access-tokens/)
721
+ you'll need to specify the `/accounts/{accountID}/wallets.write` scope.
722
+
723
+ :param wallet_id: Identifier for the wallet.
724
+ :param account_id: The Moov account ID the wallet belongs to.
725
+ :param name:
726
+ :param status: Status of a wallet. - `active`: The wallet is available for use and has an enabled payment method. - `closed`: The wallet is no longer active and the corresponding payment method has been disabled.
727
+ :param description:
728
+ :param metadata: Free-form key-value pair list. Useful for storing information that is not captured elsewhere.
729
+ :param retries: Override the default retry configuration for this method
730
+ :param server_url: Override the default server URL for this method
731
+ :param timeout_ms: Override the default request timeout configuration for this method in milliseconds
732
+ :param http_headers: Additional headers to set or replace on requests.
733
+ """
734
+ base_url = None
735
+ url_variables = None
736
+ if timeout_ms is None:
737
+ timeout_ms = self.sdk_configuration.timeout_ms
738
+
739
+ if server_url is not None:
740
+ base_url = server_url
741
+ else:
742
+ base_url = self._get_url(base_url, url_variables)
743
+
744
+ request = operations.UpdateWalletRequest(
745
+ wallet_id=wallet_id,
746
+ account_id=account_id,
747
+ patch_wallet=components.PatchWallet(
748
+ name=name,
749
+ status=status,
750
+ description=description,
751
+ metadata=metadata,
752
+ ),
753
+ )
754
+
755
+ req = self._build_request(
756
+ method="PATCH",
757
+ path="/accounts/{accountID}/wallets/{walletID}",
758
+ base_url=base_url,
759
+ url_variables=url_variables,
760
+ request=request,
761
+ request_body_required=True,
762
+ request_has_path_params=True,
763
+ request_has_query_params=True,
764
+ user_agent_header="user-agent",
765
+ accept_header_value="application/json",
766
+ http_headers=http_headers,
767
+ _globals=operations.UpdateWalletGlobals(
768
+ x_moov_version=self.sdk_configuration.globals.x_moov_version,
769
+ ),
770
+ security=self.sdk_configuration.security,
771
+ get_serialized_body=lambda: utils.serialize_request_body(
772
+ request.patch_wallet, False, False, "json", components.PatchWallet
773
+ ),
774
+ timeout_ms=timeout_ms,
775
+ )
776
+
777
+ if retries == UNSET:
778
+ if self.sdk_configuration.retry_config is not UNSET:
779
+ retries = self.sdk_configuration.retry_config
780
+
781
+ retry_config = None
782
+ if isinstance(retries, utils.RetryConfig):
783
+ retry_config = (retries, ["429", "500", "502", "503", "504"])
784
+
785
+ http_res = self.do_request(
786
+ hook_ctx=HookContext(
787
+ config=self.sdk_configuration,
788
+ base_url=base_url or "",
789
+ operation_id="updateWallet",
790
+ oauth2_scopes=[],
791
+ security_source=get_security_from_env(
792
+ self.sdk_configuration.security, components.Security
793
+ ),
794
+ ),
795
+ request=req,
796
+ error_status_codes=[
797
+ "400",
798
+ "401",
799
+ "403",
800
+ "404",
801
+ "409",
802
+ "422",
803
+ "429",
804
+ "4XX",
805
+ "500",
806
+ "504",
807
+ "5XX",
808
+ ],
809
+ retry_config=retry_config,
810
+ )
811
+
812
+ response_data: Any = None
813
+ if utils.match_response(http_res, "200", "application/json"):
814
+ return operations.UpdateWalletResponse(
815
+ result=unmarshal_json_response(components.Wallet, http_res),
816
+ headers=utils.get_response_headers(http_res.headers),
817
+ )
818
+ if utils.match_response(http_res, ["400", "409"], "application/json"):
819
+ response_data = unmarshal_json_response(errors.GenericErrorData, http_res)
820
+ raise errors.GenericError(response_data, http_res)
821
+ if utils.match_response(http_res, "422", "application/json"):
822
+ response_data = unmarshal_json_response(
823
+ errors.PatchWalletErrorData, http_res
824
+ )
825
+ raise errors.PatchWalletError(response_data, http_res)
826
+ if utils.match_response(http_res, ["401", "403", "404", "429"], "*"):
827
+ http_res_text = utils.stream_to_text(http_res)
828
+ raise errors.APIError("API error occurred", http_res, http_res_text)
829
+ if utils.match_response(http_res, ["500", "504"], "*"):
830
+ http_res_text = utils.stream_to_text(http_res)
831
+ raise errors.APIError("API error occurred", http_res, http_res_text)
832
+ if utils.match_response(http_res, "4XX", "*"):
833
+ http_res_text = utils.stream_to_text(http_res)
834
+ raise errors.APIError("API error occurred", http_res, http_res_text)
835
+ if utils.match_response(http_res, "5XX", "*"):
836
+ http_res_text = utils.stream_to_text(http_res)
837
+ raise errors.APIError("API error occurred", http_res, http_res_text)
838
+
839
+ raise errors.APIError("Unexpected response received", http_res)
840
+
841
+ async def update_async(
842
+ self,
843
+ *,
844
+ wallet_id: str,
845
+ account_id: str,
846
+ name: Optional[str] = None,
847
+ status: Optional[components.WalletStatus] = None,
848
+ description: Optional[str] = None,
849
+ metadata: Optional[Dict[str, str]] = None,
850
+ retries: OptionalNullable[utils.RetryConfig] = UNSET,
851
+ server_url: Optional[str] = None,
852
+ timeout_ms: Optional[int] = None,
853
+ http_headers: Optional[Mapping[str, str]] = None,
854
+ ) -> operations.UpdateWalletResponse:
855
+ r"""Update properties of an existing wallet such as name, description, status, or metadata.
856
+
857
+ Read our [Moov wallets guide](https://docs.moov.io/guides/sources/wallets/) to learn more.
858
+
859
+ To access this endpoint using an [access token](https://docs.moov.io/api/authentication/access-tokens/)
860
+ you'll need to specify the `/accounts/{accountID}/wallets.write` scope.
861
+
862
+ :param wallet_id: Identifier for the wallet.
863
+ :param account_id: The Moov account ID the wallet belongs to.
864
+ :param name:
865
+ :param status: Status of a wallet. - `active`: The wallet is available for use and has an enabled payment method. - `closed`: The wallet is no longer active and the corresponding payment method has been disabled.
866
+ :param description:
867
+ :param metadata: Free-form key-value pair list. Useful for storing information that is not captured elsewhere.
868
+ :param retries: Override the default retry configuration for this method
869
+ :param server_url: Override the default server URL for this method
870
+ :param timeout_ms: Override the default request timeout configuration for this method in milliseconds
871
+ :param http_headers: Additional headers to set or replace on requests.
872
+ """
873
+ base_url = None
874
+ url_variables = None
875
+ if timeout_ms is None:
876
+ timeout_ms = self.sdk_configuration.timeout_ms
877
+
878
+ if server_url is not None:
879
+ base_url = server_url
880
+ else:
881
+ base_url = self._get_url(base_url, url_variables)
882
+
883
+ request = operations.UpdateWalletRequest(
884
+ wallet_id=wallet_id,
885
+ account_id=account_id,
886
+ patch_wallet=components.PatchWallet(
887
+ name=name,
888
+ status=status,
889
+ description=description,
890
+ metadata=metadata,
891
+ ),
892
+ )
893
+
894
+ req = self._build_request_async(
895
+ method="PATCH",
896
+ path="/accounts/{accountID}/wallets/{walletID}",
897
+ base_url=base_url,
898
+ url_variables=url_variables,
899
+ request=request,
900
+ request_body_required=True,
901
+ request_has_path_params=True,
902
+ request_has_query_params=True,
903
+ user_agent_header="user-agent",
904
+ accept_header_value="application/json",
905
+ http_headers=http_headers,
906
+ _globals=operations.UpdateWalletGlobals(
907
+ x_moov_version=self.sdk_configuration.globals.x_moov_version,
908
+ ),
909
+ security=self.sdk_configuration.security,
910
+ get_serialized_body=lambda: utils.serialize_request_body(
911
+ request.patch_wallet, False, False, "json", components.PatchWallet
912
+ ),
913
+ timeout_ms=timeout_ms,
914
+ )
915
+
916
+ if retries == UNSET:
917
+ if self.sdk_configuration.retry_config is not UNSET:
918
+ retries = self.sdk_configuration.retry_config
919
+
920
+ retry_config = None
921
+ if isinstance(retries, utils.RetryConfig):
922
+ retry_config = (retries, ["429", "500", "502", "503", "504"])
923
+
924
+ http_res = await self.do_request_async(
925
+ hook_ctx=HookContext(
926
+ config=self.sdk_configuration,
927
+ base_url=base_url or "",
928
+ operation_id="updateWallet",
929
+ oauth2_scopes=[],
930
+ security_source=get_security_from_env(
931
+ self.sdk_configuration.security, components.Security
932
+ ),
933
+ ),
934
+ request=req,
935
+ error_status_codes=[
936
+ "400",
937
+ "401",
938
+ "403",
939
+ "404",
940
+ "409",
941
+ "422",
942
+ "429",
943
+ "4XX",
944
+ "500",
945
+ "504",
946
+ "5XX",
947
+ ],
948
+ retry_config=retry_config,
949
+ )
950
+
951
+ response_data: Any = None
952
+ if utils.match_response(http_res, "200", "application/json"):
953
+ return operations.UpdateWalletResponse(
954
+ result=unmarshal_json_response(components.Wallet, http_res),
955
+ headers=utils.get_response_headers(http_res.headers),
956
+ )
957
+ if utils.match_response(http_res, ["400", "409"], "application/json"):
958
+ response_data = unmarshal_json_response(errors.GenericErrorData, http_res)
959
+ raise errors.GenericError(response_data, http_res)
960
+ if utils.match_response(http_res, "422", "application/json"):
961
+ response_data = unmarshal_json_response(
962
+ errors.PatchWalletErrorData, http_res
963
+ )
964
+ raise errors.PatchWalletError(response_data, http_res)
965
+ if utils.match_response(http_res, ["401", "403", "404", "429"], "*"):
966
+ http_res_text = await utils.stream_to_text_async(http_res)
967
+ raise errors.APIError("API error occurred", http_res, http_res_text)
968
+ if utils.match_response(http_res, ["500", "504"], "*"):
969
+ http_res_text = await utils.stream_to_text_async(http_res)
970
+ raise errors.APIError("API error occurred", http_res, http_res_text)
971
+ if utils.match_response(http_res, "4XX", "*"):
972
+ http_res_text = await utils.stream_to_text_async(http_res)
973
+ raise errors.APIError("API error occurred", http_res, http_res_text)
974
+ if utils.match_response(http_res, "5XX", "*"):
975
+ http_res_text = await utils.stream_to_text_async(http_res)
976
+ raise errors.APIError("API error occurred", http_res, http_res_text)
977
+
978
+ raise errors.APIError("Unexpected response received", http_res)