moovio_sdk 0.8.2__py3-none-any.whl → 0.9.0__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/_version.py CHANGED
@@ -3,10 +3,10 @@
3
3
  import importlib.metadata
4
4
 
5
5
  __title__: str = "moovio_sdk"
6
- __version__: str = "0.8.2"
6
+ __version__: str = "0.9.0"
7
7
  __openapi_doc_version__: str = "latest"
8
- __gen_version__: str = "2.597.9"
9
- __user_agent__: str = "speakeasy-sdk/python 0.8.2 2.597.9 latest moovio_sdk"
8
+ __gen_version__: str = "2.599.0"
9
+ __user_agent__: str = "speakeasy-sdk/python 0.9.0 2.599.0 latest moovio_sdk"
10
10
 
11
11
  try:
12
12
  if __package__ is not None:
moovio_sdk/cards.py CHANGED
@@ -160,7 +160,7 @@ class Cards(BaseSDK):
160
160
  result=utils.unmarshal_json(http_res.text, components.Card),
161
161
  headers=utils.get_response_headers(http_res.headers),
162
162
  )
163
- if utils.match_response(http_res, ["400", "409"], "application/json"):
163
+ if utils.match_response(http_res, "400", "application/json"):
164
164
  response_data = utils.unmarshal_json(http_res.text, errors.GenericErrorData)
165
165
  raise errors.GenericError(data=response_data)
166
166
  if utils.match_response(http_res, "422", "application/json"):
@@ -168,7 +168,7 @@ class Cards(BaseSDK):
168
168
  http_res.text, errors.LinkCardErrorData
169
169
  )
170
170
  raise errors.LinkCardError(data=response_data)
171
- if utils.match_response(http_res, ["401", "403", "404", "429"], "*"):
171
+ if utils.match_response(http_res, ["401", "403", "404", "409", "429"], "*"):
172
172
  http_res_text = utils.stream_to_text(http_res)
173
173
  raise errors.APIError(
174
174
  "API error occurred", http_res.status_code, http_res_text, http_res
@@ -348,7 +348,7 @@ class Cards(BaseSDK):
348
348
  result=utils.unmarshal_json(http_res.text, components.Card),
349
349
  headers=utils.get_response_headers(http_res.headers),
350
350
  )
351
- if utils.match_response(http_res, ["400", "409"], "application/json"):
351
+ if utils.match_response(http_res, "400", "application/json"):
352
352
  response_data = utils.unmarshal_json(http_res.text, errors.GenericErrorData)
353
353
  raise errors.GenericError(data=response_data)
354
354
  if utils.match_response(http_res, "422", "application/json"):
@@ -356,7 +356,7 @@ class Cards(BaseSDK):
356
356
  http_res.text, errors.LinkCardErrorData
357
357
  )
358
358
  raise errors.LinkCardError(data=response_data)
359
- if utils.match_response(http_res, ["401", "403", "404", "429"], "*"):
359
+ if utils.match_response(http_res, ["401", "403", "404", "409", "429"], "*"):
360
360
  http_res_text = await utils.stream_to_text_async(http_res)
361
361
  raise errors.APIError(
362
362
  "API error occurred", http_res.status_code, http_res_text, http_res
moovio_sdk/httpclient.py CHANGED
@@ -2,7 +2,6 @@
2
2
 
3
3
  # pyright: reportReturnType = false
4
4
  import asyncio
5
- from concurrent.futures import ThreadPoolExecutor
6
5
  from typing_extensions import Protocol, runtime_checkable
7
6
  import httpx
8
7
  from typing import Any, Optional, Union
@@ -116,21 +115,42 @@ def close_clients(
116
115
  pass
117
116
 
118
117
  if async_client is not None and not async_client_supplied:
119
- is_async = False
118
+ # First, try the simplest approach - use asyncio.run()
119
+ # This works when we're not in an async context
120
120
  try:
121
- asyncio.get_running_loop()
122
- is_async = True
123
- except RuntimeError:
124
- pass
125
-
126
- try:
127
- # If this function is called in an async loop then start another
128
- # loop in a separate thread to close the async http client.
129
- if is_async:
130
- with ThreadPoolExecutor(max_workers=1) as executor:
131
- future = executor.submit(asyncio.run, async_client.aclose())
132
- future.result()
121
+ asyncio.run(async_client.aclose())
122
+ except RuntimeError as e:
123
+ # If we get "RuntimeError: This event loop is already running",
124
+ # it means we're in an async context
125
+ if "already running" in str(e):
126
+ try:
127
+ # We're in an async context, so get the running loop
128
+ loop = asyncio.get_running_loop()
129
+ # Create a task but don't wait for it
130
+ loop.create_task(async_client.aclose())
131
+ except Exception:
132
+ # If we can't get the loop or create a task, just ignore
133
+ # The GC will eventually clean up the resources
134
+ pass
135
+ # If we get "RuntimeError: There is no current event loop in thread",
136
+ # we're not in an async context, but asyncio.run() failed for some reason
137
+ # In this case, we can try to create a new event loop explicitly
138
+ elif "no current event loop" in str(e):
139
+ try:
140
+ # Create a new event loop and run the coroutine
141
+ loop = asyncio.new_event_loop()
142
+ asyncio.set_event_loop(loop)
143
+ try:
144
+ loop.run_until_complete(async_client.aclose())
145
+ finally:
146
+ loop.close()
147
+ asyncio.set_event_loop(None)
148
+ except Exception:
149
+ # If this also fails, just ignore
150
+ pass
151
+ # For any other RuntimeError, just ignore
133
152
  else:
134
- asyncio.run(async_client.aclose())
153
+ pass
135
154
  except Exception:
155
+ # For any other exception, just ignore
136
156
  pass
@@ -56,7 +56,7 @@ class CreateTransferRequestTypedDict(TypedDict):
56
56
  x_idempotency_key: str
57
57
  r"""Prevents duplicate transfers from being created."""
58
58
  account_id: str
59
- r"""The merchant's Moov account ID."""
59
+ r"""Your Moov account ID."""
60
60
  create_transfer: components_createtransfer.CreateTransferTypedDict
61
61
  x_wait_for: NotRequired[components_transferwaitfor.TransferWaitFor]
62
62
  r"""Optional header that indicates whether to return a synchronous response that includes full transfer and rail-specific details or an
@@ -77,7 +77,7 @@ class CreateTransferRequest(BaseModel):
77
77
  pydantic.Field(alias="accountID"),
78
78
  FieldMetadata(path=PathParamMetadata(style="simple", explode=False)),
79
79
  ]
80
- r"""The merchant's Moov account ID."""
80
+ r"""Your Moov account ID."""
81
81
 
82
82
  create_transfer: Annotated[
83
83
  components_createtransfer.CreateTransfer,
moovio_sdk/transfers.py CHANGED
@@ -46,7 +46,7 @@ class Transfers(BaseSDK):
46
46
  you'll need to specify the `/accounts/{accountID}/transfers.write` scope.
47
47
 
48
48
  :param x_idempotency_key: Prevents duplicate transfers from being created.
49
- :param account_id: The merchant's Moov account ID.
49
+ :param account_id: Your Moov account ID.
50
50
  :param source: Where funds for a transfer originate. For the source, you must include either a `paymentMethodID` or a `transferID`.
51
51
  :param destination: The final stage of a transfer and the ultimate recipient of the funds.
52
52
  :param amount:
@@ -239,7 +239,7 @@ class Transfers(BaseSDK):
239
239
  you'll need to specify the `/accounts/{accountID}/transfers.write` scope.
240
240
 
241
241
  :param x_idempotency_key: Prevents duplicate transfers from being created.
242
- :param account_id: The merchant's Moov account ID.
242
+ :param account_id: Your Moov account ID.
243
243
  :param source: Where funds for a transfer originate. For the source, you must include either a `paymentMethodID` or a `transferID`.
244
244
  :param destination: The final stage of a transfer and the ultimate recipient of the funds.
245
245
  :param amount:
@@ -1,11 +1,10 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: moovio_sdk
3
- Version: 0.8.2
3
+ Version: 0.9.0
4
4
  Summary: Python Client SDK Generated by Speakeasy.
5
5
  Author: Speakeasy
6
- Requires-Python: >=3.9
6
+ Requires-Python: >=3.9.2
7
7
  Classifier: Programming Language :: Python :: 3
8
- Classifier: Programming Language :: Python :: 3.9
9
8
  Classifier: Programming Language :: Python :: 3.10
10
9
  Classifier: Programming Language :: Python :: 3.11
11
10
  Classifier: Programming Language :: Python :: 3.12
@@ -3,7 +3,7 @@ moovio_sdk/_hooks/__init__.py,sha256=9_7W5jAYw8rcO8Kfc-Ty-lB82BHfksAJJpVFb_UeU1c
3
3
  moovio_sdk/_hooks/registration.py,sha256=1QZB41w6If7I9dXiOSQx6dhSc6BPWrnI5Q5bMOr4iVA,624
4
4
  moovio_sdk/_hooks/sdkhooks.py,sha256=2XuMgiV2N7UE7lN00Is-c3spxVWigYitXS6xSmS_Qow,2560
5
5
  moovio_sdk/_hooks/types.py,sha256=xAyw_8EoIrUHL-zLoqXrogOkBq1ZFICNGZfp9xne2ww,2813
6
- moovio_sdk/_version.py,sha256=LOqCtgj1XVO5Usse7GPW9eXK3XnVbSji5Eu0w1QtFXY,464
6
+ moovio_sdk/_version.py,sha256=DiDz2YwRITb8bamvuyaWDPjegukajanGb5uTmjZhGZM,464
7
7
  moovio_sdk/account_terminal_applications.py,sha256=7Td1lpM3mqBQGPLoU5fLWZKRII1CjWikuUdD5bll4NI,41863
8
8
  moovio_sdk/accounts.py,sha256=wMrhNHl6SDhKp8TSFXkpRupPljkxphDojVus8erk2PU,108249
9
9
  moovio_sdk/adjustments.py,sha256=m7S8Vn0KB4bMaTQTX50sCPvNZr72kjA6DTLxeJ2U-fc,19272
@@ -15,14 +15,14 @@ moovio_sdk/basesdk.py,sha256=cLruVIfCxE4ErFOhIFyPQX0enkJetyCIjzsfo_YvNXA,12239
15
15
  moovio_sdk/branding.py,sha256=suNLnzLwtzqWXD1XHVkukc3GL6j0icoAGY6EB3lKadA,44607
16
16
  moovio_sdk/capabilities.py,sha256=kOkkm3z4TKbebH_YxSb9vJZPzAgO8_Z3wkdIqEE3Cx4,42758
17
17
  moovio_sdk/card_issuing.py,sha256=ivtve-6ku-VDGCM50F0QIQlKfdk0-x6o-ABCE6PySCs,58006
18
- moovio_sdk/cards.py,sha256=K_cuLxxqcmtmdkn5AwFSn6yk-itkVbLgsTm5g5XE2lc,63144
18
+ moovio_sdk/cards.py,sha256=d18Lswxj5BX8W8M6Dy9MUcdUhrY2p11tvuSsodg7Ir4,63140
19
19
  moovio_sdk/disputes.py,sha256=D3ub4dQaamrDccjz2DzeIOpnrbM4yd607Y4xtd846e8,125051
20
20
  moovio_sdk/end_to_end_encryption.py,sha256=1pTy0tnYjXSBRBd5T_oDl37zj8vIcN2l59ExsPpsPOY,19256
21
21
  moovio_sdk/enriched_address.py,sha256=mQSh_xid5zmLoFvs1cNQ-v2I5xvC1YxBqgi_TgUo2Po,14800
22
22
  moovio_sdk/enriched_profile.py,sha256=rKzUQKvfOm7UHAWengfXZAw6iQoz0UoftEzUOfOlWTk,9794
23
23
  moovio_sdk/fee_plans.py,sha256=tj1ecxF97VyIA3Ca-Ti_t8GJsQnYWogGYWMAg1FUUME,73756
24
24
  moovio_sdk/files.py,sha256=YE2CytR7qtBFuTPuSFMeP0b2TuM71a0hRZoUVw3c1KU,32142
25
- moovio_sdk/httpclient.py,sha256=lC-YQ7q4yiJGKElxBeb3aZnr-4aYxjgEpZ6roeXYlyg,4318
25
+ moovio_sdk/httpclient.py,sha256=xAUX3nxG-fwYAE9lfv9uaspYKMFRJf5NM79mV2HKb1I,5486
26
26
  moovio_sdk/industries.py,sha256=7VputoHEST4GXazczXDWEYsSkfWkFJaTSXAEDx267Vo,10245
27
27
  moovio_sdk/institutions.py,sha256=1CjxrmzYf0tAs2beUyYiVPO9w8jibwG-Ya9ifXifUG8,11238
28
28
  moovio_sdk/issuing_transactions.py,sha256=ftaJUPR8vGuNVOf3oWgecZG7DQSYRZiHZTtRfXMacgc,53212
@@ -484,7 +484,7 @@ moovio_sdk/models/operations/createreversal.py,sha256=nQIIp68Itf7mtVTpeIDrDUZWsK
484
484
  moovio_sdk/models/operations/createschedule.py,sha256=vxJYRV6gAF6OuOCwZ8soVGHPNOaFNid_uofiphsYWsU,2751
485
485
  moovio_sdk/models/operations/createsweepconfig.py,sha256=mC-dbVIizvTJjYTygLrFOO-C9Uv8nMDlGrDfVboN6e8,2765
486
486
  moovio_sdk/models/operations/createterminalapplication.py,sha256=n7mnj-ixVXSV8El7dVhwueNm4Pd8xTiTefI1oayrIGE,2188
487
- moovio_sdk/models/operations/createtransfer.py,sha256=gkOOByWzgyFCYrAfBCbNc0YPIT3rUpnr4SdeRZi9I6g,4726
487
+ moovio_sdk/models/operations/createtransfer.py,sha256=UeGpxBVsHy_sES-xLfdAqNFXExQxYgbPIQOOlAItzcU,4706
488
488
  moovio_sdk/models/operations/createtransferoptions.py,sha256=DCrQtu3VPSdEOSt8gFnZHcCtRIN-c6NHBohifMolCzg,2139
489
489
  moovio_sdk/models/operations/deletedisputeevidencefile.py,sha256=NHUuvakVuXiCwqI_gDDgjhFAAfKypztOzasr0S78KQE,2648
490
490
  moovio_sdk/models/operations/deleterepresentative.py,sha256=H3bKQTMMsB9_wCqxfZqwgq-NljV5W-lGWzXIHEnxxv0,2582
@@ -612,7 +612,7 @@ moovio_sdk/sdk.py,sha256=N_Qm-P2hwu_8VkrropsIpbHn8fOjfpp9mnDAb6mN1B8,10308
612
612
  moovio_sdk/sdkconfiguration.py,sha256=7NP1kNUcms-14o77cdoPmV7ZGWTtCLqqMTWN6pdwm-8,1822
613
613
  moovio_sdk/sweeps.py,sha256=6QLuQRTQRRQ3qRyG9ZBPz1fkK3tnZeRAg_0YK6Scdts,66711
614
614
  moovio_sdk/terminal_applications.py,sha256=lOnAQYqYRoNvE6c6p7YZi2OFeer8I27tQhtX5w6oyiY,42830
615
- moovio_sdk/transfers.py,sha256=aYGm2hNcuSgU0Z-iCxnRTQcT1NFo6wqewk6eyF9caPE,133138
615
+ moovio_sdk/transfers.py,sha256=SDTuvVr3jY56xeKKh51bfbFT66Ev0B0DPh3Uqw3dhHQ,133118
616
616
  moovio_sdk/types/__init__.py,sha256=RArOwSgeeTIva6h-4ttjXwMUeCkz10nAFBL9D-QljI4,377
617
617
  moovio_sdk/types/basemodel.py,sha256=L79WXvTECbSqaJzs8D3ud_KdIWkU7Cx2wbohDAktE9E,1127
618
618
  moovio_sdk/underwriting.py,sha256=Q3bOkxgz3syy6YgdTKK_DTAqK6lV_uawgVZZX3iPuqc,24353
@@ -634,6 +634,6 @@ moovio_sdk/utils/url.py,sha256=BgGPgcTA6MRK4bF8fjP2dUopN3NzEzxWMXPBVg8NQUA,5254
634
634
  moovio_sdk/utils/values.py,sha256=CcaCXEa3xHhkUDROyXZocN8f0bdITftv9Y0P9lTf0YM,3517
635
635
  moovio_sdk/wallet_transactions.py,sha256=gP5AYXIn4LkCtm1ncheuWGxZCK0d67b20UIDheo_Khg,24943
636
636
  moovio_sdk/wallets.py,sha256=5RcHiuHxBDi2YmK0V83s1hwEN-29aFar17LsQIYXpo0,19250
637
- moovio_sdk-0.8.2.dist-info/METADATA,sha256=nHPqRyrEVeujMooOlcOmSrFdv3L-AJB3pWcIPnIV1D8,105428
638
- moovio_sdk-0.8.2.dist-info/WHEEL,sha256=b4K_helf-jlQoXBBETfwnf4B04YC67LOev0jo4fX5m8,88
639
- moovio_sdk-0.8.2.dist-info/RECORD,,
637
+ moovio_sdk-0.9.0.dist-info/METADATA,sha256=pZemo3COdsN1yFltfkyuOXMmGQfbc_AHt23oKgC_sh0,105380
638
+ moovio_sdk-0.9.0.dist-info/WHEEL,sha256=b4K_helf-jlQoXBBETfwnf4B04YC67LOev0jo4fX5m8,88
639
+ moovio_sdk-0.9.0.dist-info/RECORD,,