Source code for hmrc.cli.hello
"""Hello World API command line interface"""
from . import Command, LoginCommand
from ..api.hello import HelloClient
__all__ = [
'HelloCommand',
'HelloLoginCommand',
'HelloWorldCommand',
'HelloApplicationCommand',
'HelloUserCommand',
]
[docs]class HelloCommand(Command):
"""Hello World commands"""
section = 'hello'
Client = HelloClient
[docs]class HelloLoginCommand(HelloCommand, LoginCommand):
"""Log in to Hello World API"""
pass
[docs]class HelloWorldCommand(HelloCommand):
"""Test endpoint with no authorization"""
[docs] def execute(self, client):
return client.world().message
[docs]class HelloApplicationCommand(HelloCommand):
"""Test endpoint with application authorization"""
[docs] def execute(self, client):
return client.application().message
[docs]class HelloUserCommand(HelloCommand):
"""Test endpoint with user authorization"""
[docs] def execute(self, client):
return client.user().message