Code Block |
---|
| type GroupOccupancy @aws_api_key
@aws_lambda {
id: ID!
zoneId: Int
levelId: Int
name: String!
groupType: String!
customId: String
location: Location
positionsOccupancy: [PositionOccupancy]
summary: OccupancySummary
}
input GroupOccupancyInput {
id: ID!
zoneId: Int
levelId: Int
name: String!
groupType: String!
customId: String
location: LocationInput!
positionsOccupancy: [PositionOccupancyInput!]!
summary: OccupancySummaryInput!
}
type LevelOccupancy @aws_api_key
@aws_lambda {
id: Int
name: String
zoneId: Int!
floorNumber: Int
summary: OccupancySummary
}
input LevelOccupancyInput {
id: Int
zoneId: Int!
floorNumber: Int
name: String
summary: OccupancySummaryInput!
}
type Location @aws_api_key
@aws_lambda {
lat: Float!
lon: Float!
}
input LocationInput {
lat: Float!
lon: Float!
}
enum OccupancyStatus {
Occupied
Free
}
type OccupancySummary @aws_api_key
@aws_lambda {
total: Int!
occupied: Int!
| latFloat lonFloatLocationInputOccupancySummaryInput {
total: Int!
occupied: Int!
| latFloat lonFloatOccupancySummary @aws_api_key
@aws_lambda {
| totalInt occupied!
occupancyStatus: OccupancyStatus
statusChangeTime: AWSDateTime
| availableInt undefinedInt!OccupancySummaryInputPositionOccupancyInput {
id: ID!
customId: String
| total groupId: Int!
occupancyStatus: OccupancyStatus!
statusChangeTime: AWSDateTime!
| occupiedInt available: Int!
undefined: Int!
}
type PositionOccupancy @aws_api_key @aws_lambda {
id: Int!
customId: String
groupId: Int
occupancyStatus: OccupancyStatus
statusChangeTime: AWSDateTime
location: Location!
}
input PositionOccupancyInput {
id: Int!
customId: String
groupId: Int!
occupancyStatus: OccupancyStatus!
statusChangeTime: AWSDateTime!
location: LocationInput!
}
type GroupOccupancy labels: [String]
}
union RtaUpdateObject = ZoneOccupancy | LevelOccupancy | GroupOccupancy | PositionOccupancy
interface SubscriptionArea {
id: ID!
location: Location
radius: Int
zoneId: [Int]
levelId: [Int]
floorNumber: [Int]
groupId: [Int]
labels: [String]
granularity: SubscriptionGranularity!
expiresOn: AWSDateTime!
}
type SubscriptionAreaNoUpdates implements SubscriptionArea @aws_api_key
@aws_lambda {
id: ID!
location: Location
radius: Int
zoneId: [Int]
levelId: [Int]
floorNumber: [Int]
groupId: [Int]
labels: [String]
granularity: SubscriptionGranularity!
expiresOn: AWSDateTime!
}
type SubscriptionAreaWithUpdates implements SubscriptionArea @aws_api_key
@aws_lambda {
| IntID!
location: Location
radius: Int
zoneId: [Int]
| levelId: [Int]
floorNumber: [Int]
groupId: [Int]
| name! groupTypeSubscriptionGranularity!
expiresOn: | String customId: String
location: Location
positionsOccupancy: [PositionOccupancy]
updates: [RtaUpdateObject]
updateTime: AWSDateTime
}
enum SubscriptionGranularity {
Position
Level
Group
Zone
}
type ZoneOccupancy @aws_api_key
@aws_lambda {
id: ID!
name: String!
projectId: Int
summary: OccupancySummary
}
input | GroupOccupancyInput IntID!
name: String!
projectId: Int
| zoneIdIntOccupancySummaryInput!
}
type Mutation | levelId: Int
name: String!
groupType: String!
customId: String
location: LocationInput!
positionsOccupancy: [PositionOccupancyInput!]!
summary: OccupancySummaryInput!
}
type LevelOccupancy @aws_api_key @aws_lambda {
id: Int
name: String
zoneId: Int!
floorNumber: Int
summary: OccupancySummary
}
input LevelOccupancyInput {
id: Int
zoneId: Int!
floorNumber: Int
name: String
summary: OccupancySummaryInput!
}
type ZoneOccupancy @aws_api_key @aws_lambda {
id: Int!
name: String!
projectId: String
summary: OccupancySummary
}
input ZoneOccupancyInput {
id: Int!
name: String!
projectId: Int
summary: OccupancySummaryInput!
}
union RtaUpdateObject = ZoneOccupancy | LevelOccupancy | GroupOccupancy | PositionOccupancy
interface SubscriptionArea {
id: Int!
location: Location
radius: Int
zoneId: [Int]
levelId: [Int]
floorNumber: [Int]
groupId: [Int]
labels: [String]
granularity: SubscriptionGranularity!
expiresOn: AWSDateTime!
}
type SubscriptionAreaNoUpdates implements SubscriptionArea @aws_api_key @aws_lambda {
id: Int!
location: Location
radius: Int
zoneId: [Int]
levelId: [Int]
floorNumber: [Int]
groupId: [Int]
labels: [String]
granularity: SubscriptionGranularity!
expiresOn: AWSDateTime!
}
type SubscriptionAreaWithUpdates implements SubscriptionArea @aws_api_key @aws_lambda {
id: Int!
location: Location
radius: Int
zoneId: [Int]
levelId: [Int]
floorNumber: [Int]
groupId: [Int]
labels: [String]
granularity: SubscriptionGranularity!
expiresOn: AWSDateTime!
updates: [RtaUpdateObject]
updateTime: AWSDateTime
}
type Query {
groupOccupancy(id: Int!): GroupOccupancy {
createSubscriptionArea(
lat: Float,
lon: Float,
radius: Int,
zoneId: [Int],
levelId: [Int],
floorNumber: [Int],
groupId: [Int],
labels: [String],
granularity: SubscriptionGranularity
): SubscriptionAreaNoUpdates
@aws_api_key
@aws_lambda
updateSubscriptionArea(
id: ID!,
lat: Float,
lon: Float,
radius: Int,
zoneId: [Int],
levelId: [Int],
floorNumber: [Int],
groupId: [Int],
labels: [String],
granularity: SubscriptionGranularity
): SubscriptionAreaNoUpdates
@aws_api_key
@aws_lambda
updatePositionOccupancy(positionId: Int!, occupancyStatus: OccupancyStatus!, timestamp: String!): PositionOccupancy
@aws_api_key
pushPositionUpdates(
id: ID!,
location: LocationInput,
radius: Int,
zoneId: [Int],
levelId: [Int],
floorNumber: [Int],
groupId: [Int],
labels: [String],
granularity: SubscriptionGranularity!,
expiresOn: AWSDateTime!,
updates: [PositionOccupancyInput!]!,
updateTime: String!
): SubscriptionAreaWithUpdates
@aws_api_key
pushGroupUpdates(
id: ID!,
location: LocationInput,
radius: Int,
zoneId: [Int],
levelId: [Int],
floorNumber: [Int],
groupId: [Int],
labels: [String],
granularity: SubscriptionGranularity!,
expiresOn: AWSDateTime!,
updates: [GroupOccupancyInput!]!,
updateTime: String!
): SubscriptionAreaWithUpdates
@aws_api_key
pushLevelUpdates(
id: ID!,
location: LocationInput,
radius: Int,
zoneId: [Int],
levelId: [Int],
floorNumber: [Int],
groupId: [Int],
labels: [String],
granularity: SubscriptionGranularity!,
expiresOn: AWSDateTime!,
updates: [LevelOccupancyInput!]!,
updateTime: String!
): SubscriptionAreaWithUpdates
@aws_api_key
pushZoneUpdates(
id: ID!,
location: LocationInput,
radius: Int,
zoneId: [Int],
levelId: [Int],
floorNumber: [Int],
groupId: [Int],
labels: [String],
granularity: SubscriptionGranularity!,
expiresOn: AWSDateTime!,
updates: [ZoneOccupancyInput!]!,
updateTime: String!
): SubscriptionAreaWithUpdates
@aws_api_key
}
type Query {
groupOccupancy(id: ID!): GroupOccupancy
@aws_api_key
@aws_lambda
findGroupOccupancies(
ids: [Int],
lat: Float,
lon: Float,
radius: Int,
levelId: [Int!],
labels: [String!],
floorNumber: [Int!],
zoneId: [Int!],
projectId: Int,
groupCustomId: String,
limit: Int,
offset: Int
): [GroupOccupancy]
@aws_api_key
@aws_lambda
| findGroupOccupancies(
findPositionOccupancies(
ids: [Int] |
[Int!],
levelId: [Int!],
labels: | [String!],
floorNumber: [Int!] |
= 50
offset: Int
) : [GroupOccupancy] offset: Int
): [PositionOccupancy]
@aws_api_key
@aws_lambda
}
type Subscription {
onSubscriptionAreaUpdates(id: ID!): SubscriptionAreaWithUpdates
@aws_api_key
@aws_lambda
@aws_subscribe(mutations: ["pushPositionUpdates","pushGroupUpdates","pushLevelUpdates","pushZoneUpdates"])
}
# @api_key | findPositionOccupancies(admin) auth and @aws_lambda (user) auth are required for | ids: [Int]
all types apart from:
## updatePositionOccupancy
| lat:Float pushPositionUpdates
## pushGroupUpdates
## | lon:Float## pushZoneUpdates
## These are for internal | radius:Intnotification and should have exclusive admin access
schema {
| groupId[Int!]
levelId: [Int!]
floorNumber: [Int!]
zoneId: [Int!]
projectId: Int
groupCustomId: String
limit: Int = 50
offset: Int
) : [PositionOccupancy] @aws_api_key @aws_lambda
}
type Mutation {
createSubscriptionArea(
lat: Float,
lon: Float,
radius: Int,
zoneId: [Int],
levelId: [Int],
floorNumber: [Int],
groupId: [Int],
labels: [String],
granularity: SubscriptionGranularity
): SubscriptionAreaNoUpdates @aws_api_key @aws_lambda
updateSubscriptionArea(
id: Int!,
lat: Float,
lon: Float,
radius: Int,
zoneId: [Int],
levelId: [Int],
floorNumber: [Int],
groupId: [Int],
labels: [String],
granularity: SubscriptionGranularity
): SubscriptionAreaNoUpdates @aws_api_key @aws_lambda
updatePositionOccupancy(
positionId: Int!,
occupancyStatus: OccupancyStatus!,
timestamp: String!
): PositionOccupancy @aws_api_key
pushPositionUpdates(
id: Int!,
location: LocationInput,
radius: Int,
zoneId: [Int],
levelId: [Int],
floorNumber: [Int],
groupId: [Int],
labels: [String],
granularity: SubscriptionGranularity!,
expiresOn: AWSDateTime!,
updates: [PositionOccupancyInput!]!,
updateTime: String!
): SubscriptionAreaWithUpdates @aws_api_key
pushGroupUpdates(
id: Int!,
location: LocationInput,
radius: Int,
zoneId: [Int],
levelId: [Int],
floorNumber: [Int],
groupId: [Int],
labels: [String],
granularity: SubscriptionGranularity!,
expiresOn: AWSDateTime!,
updates: [GroupOccupancyInput!]!,
updateTime: String!
): SubscriptionAreaWithUpdates @aws_api_key
pushLevelUpdates(
id: Int!,
location: LocationInput,
radius: IntQuery
mutation: Mutation
subscription: Subscription
} |
|