Skip to content

Commit a931228

Browse files
authored
Merge pull request #94 from didx-xyz/feat/0.8.2
Upgrade client with 0.8.2 spec
2 parents bfba727 + f2f87cf commit a931228

File tree

14 files changed

+199
-11
lines changed

14 files changed

+199
-11
lines changed

aries_cloudcontroller/__init__.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
RevocationApi,
2626
SchemaApi,
2727
ServerApi,
28+
SettingsApi,
2829
TrustpingApi,
2930
WalletApi,
3031
)
@@ -182,6 +183,7 @@
182183
PresentationDefinition,
183184
PresentationProposal,
184185
PresentationRequest,
186+
ProfileSettings,
185187
ProtocolDescriptor,
186188
PublishRevocations,
187189
Queries,
@@ -227,6 +229,7 @@
227229
TxnOrRegisterLedgerNymResponse,
228230
TxnOrRevRegResult,
229231
TxnOrSchemaSendResult,
232+
UpdateProfileSettings,
230233
UpdateWalletRequest,
231234
V10CredentialBoundOfferRequest,
232235
V10CredentialConnFreeOfferRequest,
@@ -456,6 +459,7 @@
456459
"PresentationDefinition",
457460
"PresentationProposal",
458461
"PresentationRequest",
462+
"ProfileSettings",
459463
"ProtocolDescriptor",
460464
"PublishRevocations",
461465
"Queries",
@@ -501,6 +505,7 @@
501505
"TxnOrRegisterLedgerNymResponse",
502506
"TxnOrRevRegResult",
503507
"TxnOrSchemaSendResult",
508+
"UpdateProfileSettings",
504509
"UpdateWalletRequest",
505510
"V10CredentialBoundOfferRequest",
506511
"V10CredentialConnFreeOfferRequest",
@@ -598,6 +603,7 @@
598603
"RevocationApi",
599604
"SchemaApi",
600605
"ServerApi",
606+
"SettingsApi",
601607
"TrustpingApi",
602608
"WalletApi",
603609
]

aries_cloudcontroller/api/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
from aries_cloudcontroller.api.revocation import RevocationApi
2525
from aries_cloudcontroller.api.schema import SchemaApi
2626
from aries_cloudcontroller.api.server import ServerApi
27+
from aries_cloudcontroller.api.settings import SettingsApi
2728
from aries_cloudcontroller.api.trustping import TrustpingApi
2829
from aries_cloudcontroller.api.wallet import WalletApi
2930

@@ -52,6 +53,7 @@
5253
"RevocationApi",
5354
"SchemaApi",
5455
"ServerApi",
56+
"SettingsApi",
5557
"TrustpingApi",
5658
"WalletApi",
5759
]
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
from uplink import (
2+
Consumer,
3+
Path,
4+
Query,
5+
Body,
6+
Header,
7+
get,
8+
post,
9+
patch,
10+
put,
11+
delete,
12+
returns,
13+
json,
14+
)
15+
16+
from typing import Any, Dict, List, Optional, Union # noqa: F401
17+
18+
from aries_cloudcontroller.uplink_util import bool_query
19+
20+
from aries_cloudcontroller.model.profile_settings import ProfileSettings
21+
from aries_cloudcontroller.model.update_profile_settings import UpdateProfileSettings
22+
23+
24+
class SettingsApi(Consumer):
25+
async def settings_get(self) -> ProfileSettings:
26+
"""Get the configurable settings associated with the profile."""
27+
return await self.__settings_get()
28+
29+
async def settings_put(
30+
self, *, body: Optional[UpdateProfileSettings] = None
31+
) -> ProfileSettings:
32+
"""Update configurable settings associated with the profile."""
33+
if not body:
34+
body = UpdateProfileSettings()
35+
return await self.__settings_put(
36+
body=body,
37+
)
38+
39+
@returns.json
40+
@get("/settings")
41+
def __settings_get(self) -> ProfileSettings:
42+
"""Internal uplink method for settings_get"""
43+
44+
@returns.json
45+
@json
46+
@put("/settings")
47+
def __settings_put(
48+
self, *, body: Body(type=UpdateProfileSettings) = {}
49+
) -> ProfileSettings:
50+
"""Internal uplink method for settings_put"""

aries_cloudcontroller/client.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
from typing import Dict
33

44
import uplink
5+
56
from aries_cloudcontroller.api import (
67
ActionMenuApi,
78
BasicmessageApi,
@@ -27,6 +28,7 @@
2728
RevocationApi,
2829
SchemaApi,
2930
ServerApi,
31+
SettingsApi,
3032
TrustpingApi,
3133
WalletApi,
3234
)
@@ -57,6 +59,7 @@ class Client(AbstractAsyncContextManager):
5759
revocation: RevocationApi
5860
schema: SchemaApi
5961
server: ServerApi
62+
settings: SettingsApi
6063
trustping: TrustpingApi
6164
wallet: WalletApi
6265

@@ -100,6 +103,7 @@ def __init__(
100103
self.revocation = RevocationApi(**service_params)
101104
self.schema = SchemaApi(**service_params)
102105
self.server = ServerApi(**service_params)
106+
self.settings = SettingsApi(**service_params)
103107
self.trustping = TrustpingApi(**service_params)
104108
self.wallet = WalletApi(**service_params)
105109

aries_cloudcontroller/model/__init__.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -220,6 +220,7 @@
220220
from aries_cloudcontroller.model.presentation_definition import PresentationDefinition
221221
from aries_cloudcontroller.model.presentation_proposal import PresentationProposal
222222
from aries_cloudcontroller.model.presentation_request import PresentationRequest
223+
from aries_cloudcontroller.model.profile_settings import ProfileSettings
223224
from aries_cloudcontroller.model.protocol_descriptor import ProtocolDescriptor
224225
from aries_cloudcontroller.model.publish_revocations import PublishRevocations
225226
from aries_cloudcontroller.model.queries import Queries
@@ -279,6 +280,7 @@
279280
)
280281
from aries_cloudcontroller.model.txn_or_rev_reg_result import TxnOrRevRegResult
281282
from aries_cloudcontroller.model.txn_or_schema_send_result import TxnOrSchemaSendResult
283+
from aries_cloudcontroller.model.update_profile_settings import UpdateProfileSettings
282284
from aries_cloudcontroller.model.update_wallet_request import UpdateWalletRequest
283285
from aries_cloudcontroller.model.v10_credential_bound_offer_request import (
284286
V10CredentialBoundOfferRequest,
@@ -576,6 +578,7 @@
576578
"PresentationDefinition",
577579
"PresentationProposal",
578580
"PresentationRequest",
581+
"ProfileSettings",
579582
"ProtocolDescriptor",
580583
"PublishRevocations",
581584
"Queries",
@@ -621,6 +624,7 @@
621624
"TxnOrRegisterLedgerNymResponse",
622625
"TxnOrRevRegResult",
623626
"TxnOrSchemaSendResult",
627+
"UpdateProfileSettings",
624628
"UpdateWalletRequest",
625629
"V10CredentialBoundOfferRequest",
626630
"V10CredentialConnFreeOfferRequest",

aries_cloudcontroller/model/create_wallet_request.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ class CreateWalletRequest(BaseModel):
1616
Do not edit the class manually.
1717
1818
CreateWalletRequest - a model defined in OpenAPI
19+
extra_settings: Agent config key-value pairs [Optional].
1920
image_url: Image url for this wallet. This image url is publicized (self-attested) to other agents as part of forming a connection. [Optional].
2021
key_management_mode: Key management method to use for this wallet. [Optional].
2122
label: Label for this wallet. This label is publicized (self-attested) to other agents as part of forming a connection. [Optional].
@@ -27,6 +28,7 @@ class CreateWalletRequest(BaseModel):
2728
wallet_webhook_urls: List of Webhook URLs associated with this subwallet [Optional].
2829
"""
2930

31+
extra_settings: Optional[Dict[str, Any]] = None
3032
image_url: Optional[str] = None
3133
key_management_mode: Optional[Literal["managed"]] = None
3234
label: Optional[str] = None
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# coding: utf-8
2+
3+
from __future__ import annotations
4+
5+
from datetime import date, datetime # noqa: F401
6+
7+
import re # noqa: F401
8+
from typing import Any, Dict, List, Optional, Union, Literal # noqa: F401
9+
10+
from pydantic import AnyUrl, BaseModel, EmailStr, validator, Field, Extra # noqa: F401
11+
12+
13+
class ProfileSettings(BaseModel):
14+
"""NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
15+
16+
Do not edit the class manually.
17+
18+
ProfileSettings - a model defined in OpenAPI
19+
settings: Profile settings dict [Optional].
20+
"""
21+
22+
settings: Optional[Dict[str, Any]] = None
23+
24+
class Config:
25+
allow_population_by_field_name = True
26+
27+
28+
ProfileSettings.update_forward_refs()
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# coding: utf-8
2+
3+
from __future__ import annotations
4+
5+
from datetime import date, datetime # noqa: F401
6+
7+
import re # noqa: F401
8+
from typing import Any, Dict, List, Optional, Union, Literal # noqa: F401
9+
10+
from pydantic import AnyUrl, BaseModel, EmailStr, validator, Field, Extra # noqa: F401
11+
12+
13+
class UpdateProfileSettings(BaseModel):
14+
"""NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
15+
16+
Do not edit the class manually.
17+
18+
UpdateProfileSettings - a model defined in OpenAPI
19+
extra_settings: Agent config key-value pairs [Optional].
20+
"""
21+
22+
extra_settings: Optional[Dict[str, Any]] = None
23+
24+
class Config:
25+
allow_population_by_field_name = True
26+
27+
28+
UpdateProfileSettings.update_forward_refs()

aries_cloudcontroller/model/update_wallet_request.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,14 @@ class UpdateWalletRequest(BaseModel):
1616
Do not edit the class manually.
1717
1818
UpdateWalletRequest - a model defined in OpenAPI
19+
extra_settings: Agent config key-value pairs [Optional].
1920
image_url: Image url for this wallet. This image url is publicized (self-attested) to other agents as part of forming a connection. [Optional].
2021
label: Label for this wallet. This label is publicized (self-attested) to other agents as part of forming a connection. [Optional].
2122
wallet_dispatch_type: Webhook target dispatch type for this wallet. default - Dispatch only to webhooks associated with this wallet. base - Dispatch only to webhooks associated with the base wallet. both - Dispatch to both webhook targets. [Optional].
2223
wallet_webhook_urls: List of Webhook URLs associated with this subwallet [Optional].
2324
"""
2425

26+
extra_settings: Optional[Dict[str, Any]] = None
2527
image_url: Optional[str] = None
2628
label: Optional[str] = None
2729
wallet_dispatch_type: Optional[Literal["default", "both", "base"]] = None

generator/README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,16 +21,16 @@ cd generator
2121

2222
## Updating the OpenAPI
2323

24-
Updating the OpenAPI is only needed when a new version of ACA-Py is released. The process of updating the OpenAPI is mostly automated, you only need to run a few scripts. First determine the version you want for OpenAPI spec from the BCGov agent docker images (https://hub.docker.com/r/bcgovimages/aries-cloudagent/). Currently the default for the `retrieve-openapi.sh` script is "py36-1.16-1_0.8.1".
24+
Updating the OpenAPI is only needed when a new version of ACA-Py is released. The process of updating the OpenAPI is mostly automated, you only need to run a few scripts. First determine the version you want for OpenAPI spec from the BCGov agent docker images (https://hub.docker.com/r/bcgovimages/aries-cloudagent/). Currently the default for the `retrieve-openapi.sh` script is "py36-1.16-1_0.8.2".
2525

2626
After that you can run the following commands to update the `data/openapi.yml` file. This file should be committed.
2727

2828
```sh
2929
cd aries-cloudcontroller-python/generator
3030

31-
# Retrieve the open api file. Change `py36-1.16-1_0.8.1` if you want another version
31+
# Retrieve the open api file. Change `py36-1.16-1_0.8.2` if you want another version
3232
# See <https://hub.docker.com/r/bcgovimages/aries-cloudagent/tags> for official releases
33-
./scripts/retrieve-openapi.sh py36-1.16-1_0.8.1
33+
./scripts/retrieve-openapi.sh py36-1.16-1_0.8.2
3434

3535
# transform to OpenAPI V3
3636
./scripts/convert-to-openapi3-local.sh

0 commit comments

Comments
 (0)