@lap v0.3
# Machine-readable API spec. Each @endpoint block is one API call.
@api Lords Votes API
@version v1
@endpoints 5
@toc data(5)

@endpoint GET /data/Divisions/{divisionId}
@desc Return a Division
@required {divisionId: int(int32) # Division with ID specified}
@returns(200) {divisionId: int(int32), date: str(date-time), number: int(int32), notes: str?, title: str?, isWhipped: bool, isGovernmentContent: bool, authoritativeContentCount: int(int32), authoritativeNotContentCount: int(int32), divisionHadTellers: bool, tellerContentCount: int(int32), tellerNotContentCount: int(int32), memberContentCount: int(int32), memberNotContentCount: int(int32), sponsoringMemberId: int(int32)?, isHouse: bool?, isInquorate: bool, amendmentMotionNotes: str?, isGovernmentWin: bool?, remoteVotingStart: str(date-time)?, remoteVotingEnd: str(date-time)?, divisionWasExclusivelyRemote: bool, contentTellers: [map]?, notContentTellers: [map]?, contents: [map]?, notContents: [map]?} # Division with id matching given divisionId
@errors {400: divisionId was not valid, 404: Division with given divisionId was not found, 503: Temporary error occured when trying to get division}

@endpoint GET /data/Divisions/searchTotalResults
@desc Return total results count
@optional {SearchTerm: str, MemberId: int(int32), IncludeWhenMemberWasTeller: bool, StartDate: str(date-time), EndDate: str(date-time), DivisionNumber: int(int32), TotalVotesCast.Comparator: str, TotalVotesCast.ValueToCompare: int(int32), Majority.Comparator: str, Majority.ValueToCompare: int(int32)}
@returns(200) Division with id matching given divisionId
@errors {400: divisionId was not valid}

@endpoint GET /data/Divisions/search
@desc Return a list of Divisions
@optional {SearchTerm: str, MemberId: int(int32), IncludeWhenMemberWasTeller: bool, StartDate: str(date-time), EndDate: str(date-time), DivisionNumber: int(int32), TotalVotesCast.Comparator: str, TotalVotesCast.ValueToCompare: int(int32), Majority.Comparator: str, Majority.ValueToCompare: int(int32), skip: int(int32)=0 # The number of records to skip. Must be a positive integer. Default is 0, take: int(int32)=25 # The number of records to return per page. Must be more than 0. Default is 25}
@returns(200) List of divisions matching specified parameters
@errors {400: A parameter was not valid, 503: Temporary error occured when trying to get division}

@endpoint GET /data/Divisions/membervoting
@desc Return voting records for a Member
@required {MemberId: int(int32)}
@optional {SearchTerm: str, IncludeWhenMemberWasTeller: bool, StartDate: str(date-time), EndDate: str(date-time), DivisionNumber: int(int32), TotalVotesCast.Comparator: str, TotalVotesCast.ValueToCompare: int(int32), Majority.Comparator: str, Majority.ValueToCompare: int(int32), skip: int(int32)=0 # The number of records to skip. Must be a positive integer. Default is 0, take: int(int32)=25 # The number of records to return per page. Must be more than 0. Default is 25}
@returns(200) {memberId: int(int32), memberWasContent: bool, memberWasTeller: bool, publishedDivision: map{divisionId: int(int32), date: str(date-time), number: int(int32), notes: str?, title: str?, isWhipped: bool, isGovernmentContent: bool, authoritativeContentCount: int(int32), authoritativeNotContentCount: int(int32), divisionHadTellers: bool, tellerContentCount: int(int32), tellerNotContentCount: int(int32), memberContentCount: int(int32), memberNotContentCount: int(int32), sponsoringMemberId: int(int32)?, isHouse: bool?, isInquorate: bool, amendmentMotionNotes: str?, isGovernmentWin: bool?, remoteVotingStart: str(date-time)?, remoteVotingEnd: str(date-time)?, divisionWasExclusivelyRemote: bool, contentTellers: [map]?, notContentTellers: [map]?, contents: [map]?, notContents: [map]?}} # List of voting records for a member
@errors {400: A parameter was not valid, 503: Temporary error occured when trying to get division}

@endpoint GET /data/Divisions/groupedbyparty
@desc Return Divisions results grouped by party
@optional {SearchTerm: str, MemberId: int(int32), IncludeWhenMemberWasTeller: bool, StartDate: str(date-time), EndDate: str(date-time), DivisionNumber: int(int32), TotalVotesCast.Comparator: str, TotalVotesCast.ValueToCompare: int(int32), Majority.Comparator: str, Majority.ValueToCompare: int(int32)}
@returns(200) {divisionId: int(int32), number: int(int32), title: str?, date: str(date-time), contentCount: int(int32), notContentCount: int(int32), content: [map]?, notContent: [map]?} # List of divisions with votes grouped by party
@errors {400: A parameter was not valid}

@end
