from ariadne import QueryType, SubscriptionType, make_executable_schema, gql, ScalarType
import asyncio

type_defs = gql("""
    scalar JSON
                
    type Query {
        hello: String!
    }

    type PartyStatus {
        code: String
        rcc: Boolean
    }

    type PartyToFrom {
        phoneNumber: String
        name: String
        extensionId: String
    }

    type Party {
        accountId: String
        id: String
        direction: String
        to: PartyToFrom
        from: PartyToFrom
        status: PartyStatus
        missedCall: Boolean
        standAlone: Boolean
        muted: Boolean
    }

    type Origin {
        type: String
    }

    type RingCentralNotificationBody {
        sequence: Int
        sessionId: String
        telephonySessionId: String
        serverId: String
        eventTime: String
        parties: [Party]
        origin: Origin
    }

    type RingCentralNotification {
        uuid: String
        event: String
        timestamp: String
        subscriptionId: String
        ownerId: String
        body: RingCentralNotificationBody
    }

    type Subscription {
        ringcentralNotification: RingCentralNotification!
        testCounter: Int!
    }
""")
