Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions aries_cloudcontroller/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
RevocationApi,
SchemaApi,
ServerApi,
SettingsApi,
TrustpingApi,
WalletApi,
)
Expand Down Expand Up @@ -182,6 +183,7 @@
PresentationDefinition,
PresentationProposal,
PresentationRequest,
ProfileSettings,
ProtocolDescriptor,
PublishRevocations,
Queries,
Expand Down Expand Up @@ -227,6 +229,7 @@
TxnOrRegisterLedgerNymResponse,
TxnOrRevRegResult,
TxnOrSchemaSendResult,
UpdateProfileSettings,
UpdateWalletRequest,
V10CredentialBoundOfferRequest,
V10CredentialConnFreeOfferRequest,
Expand Down Expand Up @@ -456,6 +459,7 @@
"PresentationDefinition",
"PresentationProposal",
"PresentationRequest",
"ProfileSettings",
"ProtocolDescriptor",
"PublishRevocations",
"Queries",
Expand Down Expand Up @@ -501,6 +505,7 @@
"TxnOrRegisterLedgerNymResponse",
"TxnOrRevRegResult",
"TxnOrSchemaSendResult",
"UpdateProfileSettings",
"UpdateWalletRequest",
"V10CredentialBoundOfferRequest",
"V10CredentialConnFreeOfferRequest",
Expand Down Expand Up @@ -598,6 +603,7 @@
"RevocationApi",
"SchemaApi",
"ServerApi",
"SettingsApi",
"TrustpingApi",
"WalletApi",
]
2 changes: 2 additions & 0 deletions aries_cloudcontroller/api/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
from aries_cloudcontroller.api.revocation import RevocationApi
from aries_cloudcontroller.api.schema import SchemaApi
from aries_cloudcontroller.api.server import ServerApi
from aries_cloudcontroller.api.settings import SettingsApi
from aries_cloudcontroller.api.trustping import TrustpingApi
from aries_cloudcontroller.api.wallet import WalletApi

Expand Down Expand Up @@ -52,6 +53,7 @@
"RevocationApi",
"SchemaApi",
"ServerApi",
"SettingsApi",
"TrustpingApi",
"WalletApi",
]
50 changes: 50 additions & 0 deletions aries_cloudcontroller/api/settings.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
from uplink import (
Consumer,
Path,
Query,
Body,
Header,
get,
post,
patch,
put,
delete,
returns,
json,
)

from typing import Any, Dict, List, Optional, Union # noqa: F401

from aries_cloudcontroller.uplink_util import bool_query

from aries_cloudcontroller.model.profile_settings import ProfileSettings
from aries_cloudcontroller.model.update_profile_settings import UpdateProfileSettings


class SettingsApi(Consumer):
async def settings_get(self) -> ProfileSettings:
"""Get the configurable settings associated with the profile."""
return await self.__settings_get()

async def settings_put(
self, *, body: Optional[UpdateProfileSettings] = None
) -> ProfileSettings:
"""Update configurable settings associated with the profile."""
if not body:
body = UpdateProfileSettings()
return await self.__settings_put(
body=body,
)

@returns.json
@get("/settings")
def __settings_get(self) -> ProfileSettings:
"""Internal uplink method for settings_get"""

@returns.json
@json
@put("/settings")
def __settings_put(
self, *, body: Body(type=UpdateProfileSettings) = {}
) -> ProfileSettings:
"""Internal uplink method for settings_put"""
4 changes: 4 additions & 0 deletions aries_cloudcontroller/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
from typing import Dict

import uplink

from aries_cloudcontroller.api import (
ActionMenuApi,
BasicmessageApi,
Expand All @@ -27,6 +28,7 @@
RevocationApi,
SchemaApi,
ServerApi,
SettingsApi,
TrustpingApi,
WalletApi,
)
Expand Down Expand Up @@ -57,6 +59,7 @@ class Client(AbstractAsyncContextManager):
revocation: RevocationApi
schema: SchemaApi
server: ServerApi
settings: SettingsApi
trustping: TrustpingApi
wallet: WalletApi

Expand Down Expand Up @@ -100,6 +103,7 @@ def __init__(
self.revocation = RevocationApi(**service_params)
self.schema = SchemaApi(**service_params)
self.server = ServerApi(**service_params)
self.settings = SettingsApi(**service_params)
self.trustping = TrustpingApi(**service_params)
self.wallet = WalletApi(**service_params)

Expand Down
4 changes: 4 additions & 0 deletions aries_cloudcontroller/model/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,7 @@
from aries_cloudcontroller.model.presentation_definition import PresentationDefinition
from aries_cloudcontroller.model.presentation_proposal import PresentationProposal
from aries_cloudcontroller.model.presentation_request import PresentationRequest
from aries_cloudcontroller.model.profile_settings import ProfileSettings
from aries_cloudcontroller.model.protocol_descriptor import ProtocolDescriptor
from aries_cloudcontroller.model.publish_revocations import PublishRevocations
from aries_cloudcontroller.model.queries import Queries
Expand Down Expand Up @@ -279,6 +280,7 @@
)
from aries_cloudcontroller.model.txn_or_rev_reg_result import TxnOrRevRegResult
from aries_cloudcontroller.model.txn_or_schema_send_result import TxnOrSchemaSendResult
from aries_cloudcontroller.model.update_profile_settings import UpdateProfileSettings
from aries_cloudcontroller.model.update_wallet_request import UpdateWalletRequest
from aries_cloudcontroller.model.v10_credential_bound_offer_request import (
V10CredentialBoundOfferRequest,
Expand Down Expand Up @@ -576,6 +578,7 @@
"PresentationDefinition",
"PresentationProposal",
"PresentationRequest",
"ProfileSettings",
"ProtocolDescriptor",
"PublishRevocations",
"Queries",
Expand Down Expand Up @@ -621,6 +624,7 @@
"TxnOrRegisterLedgerNymResponse",
"TxnOrRevRegResult",
"TxnOrSchemaSendResult",
"UpdateProfileSettings",
"UpdateWalletRequest",
"V10CredentialBoundOfferRequest",
"V10CredentialConnFreeOfferRequest",
Expand Down
2 changes: 2 additions & 0 deletions aries_cloudcontroller/model/create_wallet_request.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ class CreateWalletRequest(BaseModel):
Do not edit the class manually.

CreateWalletRequest - a model defined in OpenAPI
extra_settings: Agent config key-value pairs [Optional].
image_url: Image url for this wallet. This image url is publicized (self-attested) to other agents as part of forming a connection. [Optional].
key_management_mode: Key management method to use for this wallet. [Optional].
label: Label for this wallet. This label is publicized (self-attested) to other agents as part of forming a connection. [Optional].
Expand All @@ -27,6 +28,7 @@ class CreateWalletRequest(BaseModel):
wallet_webhook_urls: List of Webhook URLs associated with this subwallet [Optional].
"""

extra_settings: Optional[Dict[str, Any]] = None
image_url: Optional[str] = None
key_management_mode: Optional[Literal["managed"]] = None
label: Optional[str] = None
Expand Down
28 changes: 28 additions & 0 deletions aries_cloudcontroller/model/profile_settings.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# coding: utf-8

from __future__ import annotations

from datetime import date, datetime # noqa: F401

import re # noqa: F401
from typing import Any, Dict, List, Optional, Union, Literal # noqa: F401

from pydantic import AnyUrl, BaseModel, EmailStr, validator, Field, Extra # noqa: F401


class ProfileSettings(BaseModel):
"""NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).

Do not edit the class manually.

ProfileSettings - a model defined in OpenAPI
settings: Profile settings dict [Optional].
"""

settings: Optional[Dict[str, Any]] = None

class Config:
allow_population_by_field_name = True


ProfileSettings.update_forward_refs()
28 changes: 28 additions & 0 deletions aries_cloudcontroller/model/update_profile_settings.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# coding: utf-8

from __future__ import annotations

from datetime import date, datetime # noqa: F401

import re # noqa: F401
from typing import Any, Dict, List, Optional, Union, Literal # noqa: F401

from pydantic import AnyUrl, BaseModel, EmailStr, validator, Field, Extra # noqa: F401


class UpdateProfileSettings(BaseModel):
"""NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).

Do not edit the class manually.

UpdateProfileSettings - a model defined in OpenAPI
extra_settings: Agent config key-value pairs [Optional].
"""

extra_settings: Optional[Dict[str, Any]] = None

class Config:
allow_population_by_field_name = True


UpdateProfileSettings.update_forward_refs()
2 changes: 2 additions & 0 deletions aries_cloudcontroller/model/update_wallet_request.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,14 @@ class UpdateWalletRequest(BaseModel):
Do not edit the class manually.

UpdateWalletRequest - a model defined in OpenAPI
extra_settings: Agent config key-value pairs [Optional].
image_url: Image url for this wallet. This image url is publicized (self-attested) to other agents as part of forming a connection. [Optional].
label: Label for this wallet. This label is publicized (self-attested) to other agents as part of forming a connection. [Optional].
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].
wallet_webhook_urls: List of Webhook URLs associated with this subwallet [Optional].
"""

extra_settings: Optional[Dict[str, Any]] = None
image_url: Optional[str] = None
label: Optional[str] = None
wallet_dispatch_type: Optional[Literal["default", "both", "base"]] = None
Expand Down
6 changes: 3 additions & 3 deletions generator/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,16 +21,16 @@ cd generator

## Updating the OpenAPI

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".
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".

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

```sh
cd aries-cloudcontroller-python/generator

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

# transform to OpenAPI V3
./scripts/convert-to-openapi3-local.sh
Expand Down
Loading