Skip to content

Commit c1b8e95

Browse files
committed
fix: remove top level union types for now
Signed-off-by: Timo Glastra <timo@animo.id>
1 parent 2d9a531 commit c1b8e95

File tree

6 files changed

+24
-47
lines changed

6 files changed

+24
-47
lines changed

aries_cloudcontroller/acapy_client.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
from typing import Optional
12
from aiohttp.client import ClientSession
23

34
from aries_cloudcontroller.client import Client
@@ -9,9 +10,9 @@ def __init__(
910
self,
1011
base_url: str,
1112
*,
12-
api_key: str = None,
13-
admin_insecure: bool = False,
14-
tenant_jwt: str = None,
13+
api_key: Optional[str] = None,
14+
admin_insecure: Optional[bool] = False,
15+
tenant_jwt: Optional[str] = None,
1516
):
1617

1718
if not api_key and not admin_insecure:

aries_cloudcontroller/api/credential_definition.py

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,6 @@
2828
from aries_cloudcontroller.model.credential_definitions_created_result import (
2929
CredentialDefinitionsCreatedResult,
3030
)
31-
from aries_cloudcontroller.model.txn_or_credential_definition_send_result import (
32-
TxnOrCredentialDefinitionSendResult,
33-
)
3431

3532

3633
class CredentialDefinitionApi(Consumer):
@@ -66,7 +63,7 @@ async def publish_cred_def(
6663
conn_id: Optional[str] = None,
6764
create_transaction_for_endorser: Optional[bool] = None,
6865
body: Optional[CredentialDefinitionSendRequest] = None
69-
) -> Union[CredentialDefinitionSendResult, TxnOrCredentialDefinitionSendResult]:
66+
) -> CredentialDefinitionSendResult:
7067
"""Sends a credential definition to the ledger"""
7168
return await self.__publish_cred_def(
7269
conn_id=conn_id,
@@ -102,5 +99,5 @@ def __publish_cred_def(
10299
conn_id: Query = None,
103100
create_transaction_for_endorser: Query = None,
104101
body: Body(type=CredentialDefinitionSendRequest) = {}
105-
) -> Union[CredentialDefinitionSendResult, TxnOrCredentialDefinitionSendResult]:
102+
) -> CredentialDefinitionSendResult:
106103
"""Internal uplink method for publish_cred_def"""

aries_cloudcontroller/api/revocation.py

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,6 @@
2929
)
3030
from aries_cloudcontroller.model.rev_regs_created import RevRegsCreated
3131
from aries_cloudcontroller.model.revoke_request import RevokeRequest
32-
from aries_cloudcontroller.model.txn_or_publish_revocations_result import (
33-
TxnOrPublishRevocationsResult,
34-
)
35-
from aries_cloudcontroller.model.txn_or_rev_reg_result import TxnOrRevRegResult
3632

3733

3834
class RevocationApi(Consumer):
@@ -109,7 +105,7 @@ async def publish_rev_reg_def(
109105
rev_reg_id: str,
110106
conn_id: Optional[str] = None,
111107
create_transaction_for_endorser: Optional[bool] = None
112-
) -> Union[RevRegResult, TxnOrRevRegResult]:
108+
) -> RevRegResult:
113109
"""Send revocation registry definition to ledger"""
114110
return await self.__publish_rev_reg_def(
115111
rev_reg_id=rev_reg_id,
@@ -137,7 +133,7 @@ async def publish_revocations(
137133
conn_id: Optional[str] = None,
138134
create_transaction_for_endorser: Optional[bool] = None,
139135
body: Optional[PublishRevocations] = None
140-
) -> Union[PublishRevocations, TxnOrPublishRevocationsResult]:
136+
) -> PublishRevocations:
141137
"""Publish pending revocations to ledger"""
142138
return await self.__publish_revocations(
143139
conn_id=conn_id,
@@ -236,7 +232,7 @@ def __publish_rev_reg_def(
236232
rev_reg_id: str,
237233
conn_id: Query = None,
238234
create_transaction_for_endorser: Query = None
239-
) -> Union[RevRegResult, TxnOrRevRegResult]:
235+
) -> RevRegResult:
240236
"""Internal uplink method for publish_rev_reg_def"""
241237

242238
@returns.json
@@ -259,7 +255,7 @@ def __publish_revocations(
259255
conn_id: Query = None,
260256
create_transaction_for_endorser: Query = None,
261257
body: Body(type=PublishRevocations) = {}
262-
) -> Union[PublishRevocations, TxnOrPublishRevocationsResult]:
258+
) -> PublishRevocations:
263259
"""Internal uplink method for publish_revocations"""
264260

265261
@returns.json

aries_cloudcontroller/api/schema.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020
from aries_cloudcontroller.model.schema_send_request import SchemaSendRequest
2121
from aries_cloudcontroller.model.schema_send_result import SchemaSendResult
2222
from aries_cloudcontroller.model.schemas_created_result import SchemasCreatedResult
23-
from aries_cloudcontroller.model.txn_or_schema_send_result import TxnOrSchemaSendResult
2423

2524

2625
class SchemaApi(Consumer):
@@ -52,7 +51,7 @@ async def publish_schema(
5251
conn_id: Optional[str] = None,
5352
create_transaction_for_endorser: Optional[bool] = None,
5453
body: Optional[SchemaSendRequest] = None
55-
) -> Union[SchemaSendResult, TxnOrSchemaSendResult]:
54+
) -> SchemaSendResult:
5655
"""Sends a schema to the ledger"""
5756
return await self.__publish_schema(
5857
conn_id=conn_id,
@@ -86,5 +85,5 @@ def __publish_schema(
8685
conn_id: Query = None,
8786
create_transaction_for_endorser: Query = None,
8887
body: Body(type=SchemaSendRequest) = {}
89-
) -> Union[SchemaSendResult, TxnOrSchemaSendResult]:
88+
) -> SchemaSendResult:
9089
"""Internal uplink method for publish_schema"""

generator/data/openapi.patch

Lines changed: 8 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -2,47 +2,39 @@ diff --git a/generator/data/openapi.yml b/generator/data/openapi.yml
22
index 4582107..eea7e2d 100644
33
--- a/generator/data/openapi.yml
44
+++ b/generator/data/openapi.yml
5-
@@ -705,7 +705,9 @@ paths:
5+
@@ -705,7 +705,7 @@ paths:
66
content:
77
application/json:
88
schema:
99
- $ref: '#/components/schemas/TxnOrCredentialDefinitionSendResult'
10-
+ oneOf:
11-
+ - $ref: '#/components/schemas/CredentialDefinitionSendResult'
12-
+ - $ref: '#/components/schemas/TxnOrCredentialDefinitionSendResult'
10+
+ $ref: '#/components/schemas/CredentialDefinitionSendResult'
1311
x-codegen-request-body-name: body
1412
operationId: publish_cred_def
1513
/credential-definitions/created:
16-
@@ -3263,7 +3265,9 @@ paths:
14+
@@ -3263,7 +3263,7 @@ paths:
1715
content:
1816
application/json:
1917
schema:
2018
- $ref: '#/components/schemas/TxnOrPublishRevocationsResult'
21-
+ oneOf:
22-
+ - $ref: '#/components/schemas/PublishRevocations'
23-
+ - $ref: '#/components/schemas/TxnOrPublishRevocationsResult'
19+
+ $ref: '#/components/schemas/PublishRevocations'
2420
x-codegen-request-body-name: body
2521
operationId: publish_revocations
2622
/revocation/registries/created:
27-
@@ -3374,7 +3378,9 @@ paths:
23+
@@ -3374,7 +3374,7 @@ paths:
2824
content:
2925
application/json:
3026
schema:
3127
- $ref: '#/components/schemas/TxnOrRevRegResult'
32-
+ oneOf:
33-
+ - $ref: '#/components/schemas/RevRegResult'
34-
+ - $ref: '#/components/schemas/TxnOrRevRegResult'
28+
+ $ref: '#/components/schemas/RevRegResult'
3529
operationId: publish_rev_reg_def
3630
/revocation/registry/{rev_reg_id}/entry:
3731
post:
38-
@@ -3551,7 +3557,9 @@ paths:
32+
@@ -3551,7 +3551,7 @@ paths:
3933
content:
4034
application/json:
4135
schema:
4236
- $ref: '#/components/schemas/TxnOrSchemaSendResult'
43-
+ oneOf:
44-
+ - $ref: '#/components/schemas/SchemaSendResult'
45-
+ - $ref: '#/components/schemas/TxnOrSchemaSendResult'
37+
+ $ref: '#/components/schemas/SchemaSendResult'
4638
x-codegen-request-body-name: body
4739
operationId: publish_schema
4840
/schemas/created:

generator/data/openapi.yml

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -705,9 +705,7 @@ paths:
705705
content:
706706
application/json:
707707
schema:
708-
oneOf:
709-
- $ref: "#/components/schemas/CredentialDefinitionSendResult"
710-
- $ref: "#/components/schemas/TxnOrCredentialDefinitionSendResult"
708+
$ref: "#/components/schemas/CredentialDefinitionSendResult"
711709
x-codegen-request-body-name: body
712710
operationId: publish_cred_def
713711
/credential-definitions/created:
@@ -3269,9 +3267,7 @@ paths:
32693267
content:
32703268
application/json:
32713269
schema:
3272-
oneOf:
3273-
- $ref: "#/components/schemas/PublishRevocations"
3274-
- $ref: "#/components/schemas/TxnOrPublishRevocationsResult"
3270+
$ref: "#/components/schemas/PublishRevocations"
32753271
x-codegen-request-body-name: body
32763272
operationId: publish_revocations
32773273
/revocation/registries/created:
@@ -3382,9 +3378,7 @@ paths:
33823378
content:
33833379
application/json:
33843380
schema:
3385-
oneOf:
3386-
- $ref: "#/components/schemas/RevRegResult"
3387-
- $ref: "#/components/schemas/TxnOrRevRegResult"
3381+
$ref: "#/components/schemas/RevRegResult"
33883382
operationId: publish_rev_reg_def
33893383
/revocation/registry/{rev_reg_id}/entry:
33903384
post:
@@ -3561,9 +3555,7 @@ paths:
35613555
content:
35623556
application/json:
35633557
schema:
3564-
oneOf:
3565-
- $ref: "#/components/schemas/SchemaSendResult"
3566-
- $ref: "#/components/schemas/TxnOrSchemaSendResult"
3558+
$ref: "#/components/schemas/SchemaSendResult"
35673559
x-codegen-request-body-name: body
35683560
operationId: publish_schema
35693561
/schemas/created:

0 commit comments

Comments
 (0)