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!
}
typeenum MutationOccupancyStatus {
createSubscriptionArea(Occupied
lat: Float,
lon: Float,
radius: Int,
zoneId: [Int],
levelId: [Int],
floorNumber: [Int],
groupId: [Int],
labels: [String],
granularity: SubscriptionGranularity
): SubscriptionAreaNoUpdates
Free
}
type OccupancySummary @aws_api_key
@aws_lambda {
total: Int!
occupied: Int!
available: Int!
undefined: Int!
}
input OccupancySummaryInput {
total: Int!
occupied: Int!
available: Int!
undefined: Int!
}
type PositionOccupancy @aws_api_key
@aws_lambda updateSubscriptionArea({
id: ID!,
latcustomId: Float,String
longroupId: Float,Int
radiusoccupancyStatus: Int,OccupancyStatus
zoneIdstatusChangeTime: [Int],AWSDateTime
levelIdlocation: [Int],Location!
floorNumberlabels: [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,
String]
}
input PositionOccupancyInput {
id: ID!
customId: String
groupId: Int!
occupancyStatus: OccupancyStatus!
statusChangeTime: AWSDateTime!
location: LocationInput!
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!,
updates: [PositionOccupancyInput!]!,
updateTime: String!
): SubscriptionAreaWithUpdates
}
type SubscriptionAreaNoUpdates implements SubscriptionArea @aws_api_key
pushGroupUpdates(@aws_lambda {
id: ID!,
location: LocationInput,Location
radius: Int,
zoneId: [Int],
levelId: [Int],
floorNumber: [Int],
groupId: [Int],
labels: [String],
granularity: SubscriptionGranularity!,
expiresOn: AWSDateTime!,
updates: [GroupOccupancyInput!]!,
updateTime: String!
): SubscriptionAreaWithUpdates
}
type SubscriptionAreaWithUpdates implements SubscriptionArea @aws_api_key
pushLevelUpdates(
@aws_lambda {
id: ID!,
location: LocationInput,Location
radius: Int,
zoneId: [Int],
levelId: [Int],
floorNumber: [Int],
groupId: [Int],
labels: [String],
granularity: SubscriptionGranularity!,
expiresOn: AWSDateTime!,
updates: [LevelOccupancyInput!RtaUpdateObject]!,
updateTime: String!AWSDateTime
}
enum SubscriptionGranularity {
):Position
SubscriptionAreaWithUpdates Level
Group
Zone
}
type ZoneOccupancy @aws_api_key
pushZoneUpdates(
@aws_lambda {
id: ID!,
location: LocationInputname: String!
projectId: Int
summary: OccupancySummary
}
input ZoneOccupancyInput {
id: ID!
name: String!
projectId: Int
summary: OccupancySummaryInput!
}
type Mutation {
createSubscriptionArea(
lat: Float,
lon: Float,
radius: Int,
zoneId: [Int],
levelId: [Int],
floorNumber: [Int],
groupId: [Int],
labels: [String],
granularity: SubscriptionGranularity!,
expiresOn): AWSDateTime!,SubscriptionAreaNoUpdates
updates: [ZoneOccupancyInput!]!,@aws_api_key
@aws_lambda
updateSubscriptionArea(
updateTimeid: StringID!,
)lat: SubscriptionAreaWithUpdatesFloat,
@aws_api_key
}
enum OccupancyStatus {
Occupied
Free
}
type OccupancySummary @aws_api_key
@aws_lambda {
total: Int!
occupied: Int!
available: Int!
undefined: Int!
}
input OccupancySummaryInput {
total: Int!
occupied: Int!
available: Int!
undefined: Int!
}
type PositionOccupancy @aws_api_key
@aws_lambda {
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!,
customIdlocation: StringLocationInput,
groupId radius: Int,
occupancyStatus zoneId: OccupancyStatus[Int],
statusChangeTimelevelId: AWSDateTime[Int],
locationfloorNumber: Location!
}
input PositionOccupancyInput {
id: ID!
customId: String
groupId: Int!
occupancyStatus: OccupancyStatus!
statusChangeTime: AWSDateTime!
location: LocationInput!
}
type Query {
groupOccupancy(id: ID!): GroupOccupancy
@aws_api_key
@aws_lambda
findGroupOccupancies(
ids: [Int],
lat: Float,
lon: Float,
radius: Int[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!],
zoneIdgroupId: [Int!],
labels: [String],
projectIdgranularity: IntSubscriptionGranularity!,
groupCustomIdexpiresOn: StringAWSDateTime!,
limitupdates: Int[GroupOccupancyInput!]!,
offsetupdateTime: IntString!
): [GroupOccupancy]SubscriptionAreaWithUpdates
@aws_api_key
@aws_lambda
findPositionOccupancies pushLevelUpdates(
idsid: [Int]ID!,
latlocation: FloatLocationInput,
lonradius: FloatInt,
radiuszoneId: [Int],
groupIdlevelId: [Int!],
levelIdfloorNumber: [Int!],
floorNumbergroupId: [Int!],
zoneIdlabels: [Int!String],
projectIdgranularity: IntSubscriptionGranularity!,
groupCustomIdexpiresOn: StringAWSDateTime!,
limitupdates: Int[LevelOccupancyInput!]!,
offsetupdateTime: IntString!
): [PositionOccupancy]SubscriptionAreaWithUpdates
@aws_api_key
@aws_lambda
}
union RtaUpdateObject = ZoneOccupancy | LevelOccupancy | GroupOccupancy | PositionOccupancy
type Subscription {
onSubscriptionAreaUpdates(id: ID!): SubscriptionAreaWithUpdates
@aws_api_key
@aws_lambda
@aws_subscribe(mutations: ["pushPositionUpdates","pushGroupUpdates","pushLevelUpdates","pushZoneUpdates"])
}
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 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
findPositionOccupancies(
ids: [Int],
lat: Float,
lon: Float,
radius: Int,
groupId: [Int!],
levelId: [Int!],
labels: [String!],
floorNumber: [Int!],
zoneId: [Int!],
projectId: Int,
groupCustomId: String,
limit: Int,
offset: Int
): [PositionOccupancy]
@aws_api_key
@aws_lambda
}
type Subscription {
onSubscriptionAreaUpdates(id: ID!
location): LocationSubscriptionAreaWithUpdates
radius: Int
zoneId: [Int]
levelId: [Int]
floorNumber: [Int]
groupId: [Int]
labels: [String]
granularity: SubscriptionGranularity!
expiresOn: AWSDateTime!
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 ZoneOccupancyInput {
id: ID!
name: String!
projectId: Int
summary: OccupancySummaryInput!
}
# @api_key (admin) auth and @aws_lambda (user) auth are required for all types apart from:
## updatePositionOccupancy
## pushPositionUpdates
## pushGroupUpdates
## pushLevelUpdates
## pushZoneUpdates
## These are for internal subscription notification and should have exclusive admin access
schema {
query: Query
mutation: Mutation
subscription: Subscription
} |