from flask_restx import Resource, Namespace
import random

namespace = Namespace('coinflip', description='Coinflip related operations')


@namespace.route('/', methods=['GET'])  # resolves to /coinflip
class RollCoinflip(Resource):
    @staticmethod
    def get():
        return random.choice(['Heads', 'Tails']), 200
