+class RemoteApplicationWatcherFacade(Type):
+ name = 'RemoteApplicationWatcher'
+ version = 1
+ schema = {'definitions': {'Error': {'additionalProperties': False,
+ 'properties': {'code': {'type': 'string'},
+ 'info': {'$ref': '#/definitions/ErrorInfo'},
+ 'message': {'type': 'string'}},
+ 'required': ['message', 'code'],
+ 'type': 'object'},
+ 'ErrorInfo': {'additionalProperties': False,
+ 'properties': {'macaroon': {'$ref': '#/definitions/Macaroon'},
+ 'macaroon-path': {'type': 'string'}},
+ 'type': 'object'},
+ 'Macaroon': {'additionalProperties': False, 'type': 'object'},
+ 'RemoteApplicationChange': {'additionalProperties': False,
+ 'properties': {'application-tag': {'type': 'string'},
+ 'life': {'type': 'string'},
+ 'relations': {'$ref': '#/definitions/RemoteRelationsChange'}},
+ 'required': ['application-tag',
+ 'life',
+ 'relations'],
+ 'type': 'object'},
+ 'RemoteApplicationWatchResult': {'additionalProperties': False,
+ 'properties': {'change': {'$ref': '#/definitions/RemoteApplicationChange'},
+ 'error': {'$ref': '#/definitions/Error'},
+ 'id': {'type': 'string'}},
+ 'required': ['id'],
+ 'type': 'object'},
+ 'RemoteEntityId': {'additionalProperties': False,
+ 'properties': {'model-uuid': {'type': 'string'},
+ 'token': {'type': 'string'}},
+ 'required': ['model-uuid', 'token'],
+ 'type': 'object'},
+ 'RemoteRelationChange': {'additionalProperties': False,
+ 'properties': {'changed-units': {'patternProperties': {'.*': {'$ref': '#/definitions/RemoteRelationUnitChange'}},
+ 'type': 'object'},
+ 'departed-units': {'items': {'type': 'string'},
+ 'type': 'array'},
+ 'id': {'type': 'integer'},
+ 'life': {'type': 'string'}},
+ 'required': ['id', 'life'],
+ 'type': 'object'},
+ 'RemoteRelationUnitChange': {'additionalProperties': False,
+ 'properties': {'settings': {'patternProperties': {'.*': {'additionalProperties': True,
+ 'type': 'object'}},
+ 'type': 'object'},
+ 'unit-id': {'$ref': '#/definitions/RemoteEntityId'}},
+ 'required': ['unit-id'],
+ 'type': 'object'},
+ 'RemoteRelationsChange': {'additionalProperties': False,
+ 'properties': {'changed': {'items': {'$ref': '#/definitions/RemoteRelationChange'},
+ 'type': 'array'},
+ 'initial': {'type': 'boolean'},
+ 'removed': {'items': {'type': 'integer'},
+ 'type': 'array'}},
+ 'required': ['initial'],
+ 'type': 'object'}},
+ 'properties': {'Next': {'properties': {'Result': {'$ref': '#/definitions/RemoteApplicationWatchResult'}},
+ 'type': 'object'},
+ 'Stop': {'type': 'object'}},
+ 'type': 'object'}
+
+
+ @ReturnMapping(RemoteApplicationWatchResult)
+ async def Next(self):
+ '''
+
+ Returns -> typing.Union[_ForwardRef('RemoteApplicationChange'), _ForwardRef('Error'), str]
+ '''
+ # map input types to rpc msg
+ _params = dict()
+ msg = dict(type='RemoteApplicationWatcher', request='Next', version=1, params=_params)
+
+ reply = await self.rpc(msg)
+ return reply
+
+
+
+ @ReturnMapping(None)
+ async def Stop(self):
+ '''
+
+ Returns -> None
+ '''
+ # map input types to rpc msg
+ _params = dict()
+ msg = dict(type='RemoteApplicationWatcher', request='Stop', version=1, params=_params)
+
+ reply = await self.rpc(msg)
+ return reply
+
+
+class RemoteRelationsWatcherFacade(Type):
+ name = 'RemoteRelationsWatcher'
+ version = 1
+ schema = {'definitions': {'Error': {'additionalProperties': False,
+ 'properties': {'code': {'type': 'string'},
+ 'info': {'$ref': '#/definitions/ErrorInfo'},
+ 'message': {'type': 'string'}},
+ 'required': ['message', 'code'],
+ 'type': 'object'},
+ 'ErrorInfo': {'additionalProperties': False,
+ 'properties': {'macaroon': {'$ref': '#/definitions/Macaroon'},
+ 'macaroon-path': {'type': 'string'}},
+ 'type': 'object'},
+ 'Macaroon': {'additionalProperties': False, 'type': 'object'},
+ 'RemoteEntityId': {'additionalProperties': False,
+ 'properties': {'model-uuid': {'type': 'string'},
+ 'token': {'type': 'string'}},
+ 'required': ['model-uuid', 'token'],
+ 'type': 'object'},
+ 'RemoteRelationChange': {'additionalProperties': False,
+ 'properties': {'changed-units': {'patternProperties': {'.*': {'$ref': '#/definitions/RemoteRelationUnitChange'}},
+ 'type': 'object'},
+ 'departed-units': {'items': {'type': 'string'},
+ 'type': 'array'},
+ 'id': {'type': 'integer'},
+ 'life': {'type': 'string'}},
+ 'required': ['id', 'life'],
+ 'type': 'object'},
+ 'RemoteRelationUnitChange': {'additionalProperties': False,
+ 'properties': {'settings': {'patternProperties': {'.*': {'additionalProperties': True,
+ 'type': 'object'}},
+ 'type': 'object'},
+ 'unit-id': {'$ref': '#/definitions/RemoteEntityId'}},
+ 'required': ['unit-id'],
+ 'type': 'object'},
+ 'RemoteRelationsChange': {'additionalProperties': False,
+ 'properties': {'changed': {'items': {'$ref': '#/definitions/RemoteRelationChange'},
+ 'type': 'array'},
+ 'initial': {'type': 'boolean'},
+ 'removed': {'items': {'type': 'integer'},
+ 'type': 'array'}},
+ 'required': ['initial'],
+ 'type': 'object'},
+ 'RemoteRelationsWatchResult': {'additionalProperties': False,
+ 'properties': {'RemoteRelationsWatcherId': {'type': 'string'},
+ 'change': {'$ref': '#/definitions/RemoteRelationsChange'},
+ 'error': {'$ref': '#/definitions/Error'}},
+ 'required': ['RemoteRelationsWatcherId'],
+ 'type': 'object'}},
+ 'properties': {'Next': {'properties': {'Result': {'$ref': '#/definitions/RemoteRelationsWatchResult'}},
+ 'type': 'object'},
+ 'Stop': {'type': 'object'}},
+ 'type': 'object'}
+
+
+ @ReturnMapping(RemoteRelationsWatchResult)
+ async def Next(self):
+ '''
+
+ Returns -> typing.Union[str, _ForwardRef('RemoteRelationsChange'), _ForwardRef('Error')]
+ '''
+ # map input types to rpc msg
+ _params = dict()
+ msg = dict(type='RemoteRelationsWatcher', request='Next', version=1, params=_params)
+
+ reply = await self.rpc(msg)
+ return reply
+
+
+
+ @ReturnMapping(None)
+ async def Stop(self):
+ '''
+
+ Returns -> None
+ '''
+ # map input types to rpc msg
+ _params = dict()
+ msg = dict(type='RemoteRelationsWatcher', request='Stop', version=1, params=_params)
+
+ reply = await self.rpc(msg)
+ return reply
+
+
+class ResourcesFacade(Type):
+ name = 'Resources'
+ version = 1
+ schema = {'definitions': {'AddCharmWithAuthorization': {'additionalProperties': False,
+ 'properties': {'channel': {'type': 'string'},
+ 'macaroon': {'$ref': '#/definitions/Macaroon'},
+ 'url': {'type': 'string'}},
+ 'required': ['url',
+ 'channel',
+ 'macaroon'],
+ 'type': 'object'},
+ 'AddPendingResourcesArgs': {'additionalProperties': False,
+ 'properties': {'AddCharmWithAuthorization': {'$ref': '#/definitions/AddCharmWithAuthorization'},
+ 'Entity': {'$ref': '#/definitions/Entity'},
+ 'Resources': {'items': {'$ref': '#/definitions/CharmResource'},
+ 'type': 'array'}},
+ 'required': ['Entity',
+ 'AddCharmWithAuthorization',
+ 'Resources'],
+ 'type': 'object'},
+ 'AddPendingResourcesResult': {'additionalProperties': False,
+ 'properties': {'ErrorResult': {'$ref': '#/definitions/ErrorResult'},
+ 'pending-ids': {'items': {'type': 'string'},
+ 'type': 'array'}},
+ 'required': ['ErrorResult',
+ 'pending-ids'],
+ 'type': 'object'},
+ 'CharmResource': {'additionalProperties': False,
+ 'properties': {'description': {'type': 'string'},
+ 'fingerprint': {'items': {'type': 'integer'},
+ 'type': 'array'},
+ 'name': {'type': 'string'},
+ 'origin': {'type': 'string'},
+ 'path': {'type': 'string'},
+ 'revision': {'type': 'integer'},
+ 'size': {'type': 'integer'},
+ 'type': {'type': 'string'}},
+ 'required': ['name',
+ 'type',
+ 'path',
+ 'origin',
+ 'revision',
+ 'fingerprint',
+ 'size'],
+ 'type': 'object'},
+ 'Entity': {'additionalProperties': False,
+ 'properties': {'tag': {'type': 'string'}},
+ 'required': ['tag'],
+ 'type': 'object'},
+ 'Error': {'additionalProperties': False,
+ 'properties': {'code': {'type': 'string'},
+ 'info': {'$ref': '#/definitions/ErrorInfo'},
+ 'message': {'type': 'string'}},
+ 'required': ['message', 'code'],
+ 'type': 'object'},
+ 'ErrorInfo': {'additionalProperties': False,
+ 'properties': {'macaroon': {'$ref': '#/definitions/Macaroon'},
+ 'macaroon-path': {'type': 'string'}},
+ 'type': 'object'},
+ 'ErrorResult': {'additionalProperties': False,
+ 'properties': {'error': {'$ref': '#/definitions/Error'}},
+ 'type': 'object'},
+ 'ListResourcesArgs': {'additionalProperties': False,
+ 'properties': {'entities': {'items': {'$ref': '#/definitions/Entity'},
+ 'type': 'array'}},
+ 'required': ['entities'],
+ 'type': 'object'},
+ 'Macaroon': {'additionalProperties': False, 'type': 'object'},
+ 'Resource': {'additionalProperties': False,
+ 'properties': {'CharmResource': {'$ref': '#/definitions/CharmResource'},
+ 'application': {'type': 'string'},
+ 'id': {'type': 'string'},
+ 'pending-id': {'type': 'string'},
+ 'timestamp': {'format': 'date-time',
+ 'type': 'string'},
+ 'username': {'type': 'string'}},
+ 'required': ['CharmResource',
+ 'id',
+ 'pending-id',
+ 'application',
+ 'username',
+ 'timestamp'],
+ 'type': 'object'},
+ 'ResourcesResult': {'additionalProperties': False,
+ 'properties': {'ErrorResult': {'$ref': '#/definitions/ErrorResult'},
+ 'charm-store-resources': {'items': {'$ref': '#/definitions/CharmResource'},
+ 'type': 'array'},
+ 'resources': {'items': {'$ref': '#/definitions/Resource'},
+ 'type': 'array'},
+ 'unit-resources': {'items': {'$ref': '#/definitions/UnitResources'},
+ 'type': 'array'}},
+ 'required': ['ErrorResult',
+ 'resources',
+ 'charm-store-resources',
+ 'unit-resources'],
+ 'type': 'object'},
+ 'ResourcesResults': {'additionalProperties': False,
+ 'properties': {'results': {'items': {'$ref': '#/definitions/ResourcesResult'},
+ 'type': 'array'}},
+ 'required': ['results'],
+ 'type': 'object'},
+ 'UnitResources': {'additionalProperties': False,
+ 'properties': {'Entity': {'$ref': '#/definitions/Entity'},
+ 'download-progress': {'patternProperties': {'.*': {'type': 'integer'}},
+ 'type': 'object'},
+ 'resources': {'items': {'$ref': '#/definitions/Resource'},
+ 'type': 'array'}},
+ 'required': ['Entity',
+ 'resources',
+ 'download-progress'],
+ 'type': 'object'}},
+ 'properties': {'AddPendingResources': {'properties': {'Params': {'$ref': '#/definitions/AddPendingResourcesArgs'},
+ 'Result': {'$ref': '#/definitions/AddPendingResourcesResult'}},
+ 'type': 'object'},
+ 'ListResources': {'properties': {'Params': {'$ref': '#/definitions/ListResourcesArgs'},
+ 'Result': {'$ref': '#/definitions/ResourcesResults'}},
+ 'type': 'object'}},
+ 'type': 'object'}
+
+
+ @ReturnMapping(AddPendingResourcesResult)
+ async def AddPendingResources(self, addcharmwithauthorization, entity, resources):
+ '''
+ addcharmwithauthorization : AddCharmWithAuthorization
+ entity : Entity
+ resources : typing.Sequence<+T_co>[~CharmResource]<~CharmResource>
+ Returns -> typing.Union[_ForwardRef('ErrorResult'), typing.Sequence<+T_co>[str]]
+ '''
+ # map input types to rpc msg
+ _params = dict()
+ msg = dict(type='Resources', request='AddPendingResources', version=1, params=_params)
+ _params['AddCharmWithAuthorization'] = addcharmwithauthorization
+ _params['Entity'] = entity
+ _params['Resources'] = resources
+ reply = await self.rpc(msg)
+ return reply
+
+
+
+ @ReturnMapping(ResourcesResults)
+ async def ListResources(self, entities):
+ '''
+ entities : typing.Sequence<+T_co>[~Entity]<~Entity>
+ Returns -> typing.Sequence<+T_co>[~ResourcesResult]<~ResourcesResult>
+ '''
+ # map input types to rpc msg
+ _params = dict()
+ msg = dict(type='Resources', request='ListResources', version=1, params=_params)
+ _params['entities'] = entities
+ reply = await self.rpc(msg)
+ return reply
+
+
+class ResourcesHookContextFacade(Type):
+ name = 'ResourcesHookContext'
+ version = 1
+ schema = {'definitions': {'CharmResource': {'additionalProperties': False,
+ 'properties': {'description': {'type': 'string'},
+ 'fingerprint': {'items': {'type': 'integer'},
+ 'type': 'array'},
+ 'name': {'type': 'string'},
+ 'origin': {'type': 'string'},
+ 'path': {'type': 'string'},
+ 'revision': {'type': 'integer'},
+ 'size': {'type': 'integer'},
+ 'type': {'type': 'string'}},
+ 'required': ['name',
+ 'type',
+ 'path',
+ 'origin',
+ 'revision',
+ 'fingerprint',
+ 'size'],
+ 'type': 'object'},
+ 'Error': {'additionalProperties': False,
+ 'properties': {'code': {'type': 'string'},
+ 'info': {'$ref': '#/definitions/ErrorInfo'},
+ 'message': {'type': 'string'}},
+ 'required': ['message', 'code'],
+ 'type': 'object'},
+ 'ErrorInfo': {'additionalProperties': False,
+ 'properties': {'macaroon': {'$ref': '#/definitions/Macaroon'},
+ 'macaroon-path': {'type': 'string'}},
+ 'type': 'object'},
+ 'ErrorResult': {'additionalProperties': False,
+ 'properties': {'error': {'$ref': '#/definitions/Error'}},
+ 'type': 'object'},
+ 'ListResourcesArgs': {'additionalProperties': False,
+ 'properties': {'resource-names': {'items': {'type': 'string'},
+ 'type': 'array'}},
+ 'required': ['resource-names'],
+ 'type': 'object'},
+ 'Macaroon': {'additionalProperties': False, 'type': 'object'},
+ 'Resource': {'additionalProperties': False,
+ 'properties': {'CharmResource': {'$ref': '#/definitions/CharmResource'},
+ 'application': {'type': 'string'},
+ 'id': {'type': 'string'},
+ 'pending-id': {'type': 'string'},
+ 'timestamp': {'format': 'date-time',
+ 'type': 'string'},
+ 'username': {'type': 'string'}},
+ 'required': ['CharmResource',
+ 'id',
+ 'pending-id',
+ 'application',
+ 'username',
+ 'timestamp'],
+ 'type': 'object'},
+ 'ResourceResult': {'additionalProperties': False,
+ 'properties': {'ErrorResult': {'$ref': '#/definitions/ErrorResult'},
+ 'resource': {'$ref': '#/definitions/Resource'}},
+ 'required': ['ErrorResult', 'resource'],
+ 'type': 'object'},
+ 'ResourcesResult': {'additionalProperties': False,
+ 'properties': {'ErrorResult': {'$ref': '#/definitions/ErrorResult'},
+ 'resources': {'items': {'$ref': '#/definitions/ResourceResult'},
+ 'type': 'array'}},
+ 'required': ['ErrorResult', 'resources'],
+ 'type': 'object'}},
+ 'properties': {'GetResourceInfo': {'properties': {'Params': {'$ref': '#/definitions/ListResourcesArgs'},
+ 'Result': {'$ref': '#/definitions/ResourcesResult'}},
+ 'type': 'object'}},
+ 'type': 'object'}
+
+
+ @ReturnMapping(ResourcesResult)
+ async def GetResourceInfo(self, entities):
+ '''
+ entities : typing.Sequence<+T_co>[~Entity]<~Entity>
+ Returns -> typing.Union[_ForwardRef('ErrorResult'), typing.Sequence<+T_co>[~UnitResources]<~UnitResources>]
+ '''
+ # map input types to rpc msg
+ _params = dict()
+ msg = dict(type='ResourcesHookContext', request='GetResourceInfo', version=1, params=_params)
+ _params['entities'] = entities
+ reply = await self.rpc(msg)
+ return reply
+
+