@lap v0.3
# Machine-readable API spec. Each @endpoint block is one API call.
@api Statutory Instruments API
@version v1
@endpoints 16
@toc api(16)

@endpoint GET /api/v1/BusinessItem/{id}
@required {id: str}
@optional {LaidPaper: str}
@returns(200) {value: map{id: str?, statutoryInstrumentId: str?, stepName: str?, itemDate: str(date-time)?, houses: [map]?, link: str?, laidPaperType: str, sequence: int(int32), statutoryInstrumentUri: str(uri)?, businessItemUri: str(uri)?, houseUri: str(uri)?, houseName: str?, procedureStepUri: str(uri)?, workpackageProcedureUri: str(uri)?, houseId: str?, procedureStepId: str?}, links: [map]?}
@errors {400, 404}

@endpoint GET /api/v1/LayingBody
@returns(200) {items: [map]?, totalResults: int(int32), itemsPerPage: int(int32), links: [map]?}

@endpoint GET /api/v1/Procedure
@returns(200) {items: [map]?, totalResults: int(int32), itemsPerPage: int(int32), links: [map]?}

@endpoint GET /api/v1/Procedure/{id}
@required {id: str}
@returns(200) {value: map{id: str?, uri: str?, name: str?, description: str?}, links: [map]?}
@errors {400, 404}

@endpoint GET /api/v1/ProposedNegativeStatutoryInstrument
@optional {Name: str, RecommendedForProcedureChange: bool, DepartmentId: int(int32), LayingBodyId: str, Skip: int(int32), Take: int(int32)}
@returns(200) {items: [map]?, totalResults: int(int32), itemsPerPage: int(int32), links: [map]?}
@errors {400}

@endpoint GET /api/v1/ProposedNegativeStatutoryInstrument/{id}
@required {id: str}
@returns(200) {value: map{id: str?, commonsLayingDate: str(date-time)?, commonsPublishedDate: str(date-time)?, lordsLayingDate: str(date-time)?, lordsPublishedDate: str(date-time)?, uri: str?, name: str?, departmentId: int(int32)?, layingBodyId: str?, layingBodyName: str?, procedureUri: str?, procedureName: str?, procedure: map{id: str?, uri: str?, name: str?}, layingBodyDepartment: map{departmentId: int(int32)?, name: str?, id: str?}, link: str?, statutoryInstrumentPaperId: str?, statutoryInstrumentPaperName: str?, statutoryInstrument: map{id: str?, name: str?}}, links: [map]?}
@errors {400, 404}

@endpoint GET /api/v1/ProposedNegativeStatutoryInstrument/{id}/BusinessItems
@required {id: str}
@returns(200) {items: [map]?, totalResults: int(int32), itemsPerPage: int(int32), links: [map]?}
@errors {400, 404}

@endpoint GET /api/v1/StatutoryInstrument
@optional {Name: str, StatutoryInstrumentType: str, ScheduledDebate: bool, MotionToStop: bool, ConcernsRaisedByCommittee: bool, ParliamentaryProcessConcluded: str, DepartmentId: int(int32), LayingBodyId: str, House: str, Skip: int(int32), Take: int(int32)}
@returns(200) {items: [map]?, totalResults: int(int32), itemsPerPage: int(int32), links: [map]?}
@errors {400}

@endpoint GET /api/v1/StatutoryInstrument/{id}
@required {id: str}
@returns(200) {value: map{id: str?, commonsLayingDate: str(date-time)?, commonsPublishedDate: str(date-time)?, lordsLayingDate: str(date-time)?, lordsPublishedDate: str(date-time)?, uri: str?, name: str?, departmentId: int(int32)?, layingBodyId: str?, layingBodyName: str?, procedureUri: str?, procedureName: str?, procedure: map{id: str?, uri: str?, name: str?}, layingBodyDepartment: map{departmentId: int(int32)?, name: str?, id: str?}, link: str?, paperNumber: int(int32)?, paperYear: str?, paperPrefix: str?, paperMadeDate: str(date-time), paperComingIntoForceDate: str(date-time)?, paperComingIntoForceNote: str?, proposedNegativeStatutoryInstrumentPaperId: str?, proposedNegativeStatutoryInstrumentPaperName: str?, proposedNegativeStatutoryInstrument: map{id: str?, name: str?}}, links: [map]?}
@errors {400, 404}

@endpoint GET /api/v1/StatutoryInstrument/{id}/BusinessItems
@required {id: str}
@returns(200) {items: [map]?, totalResults: int(int32), itemsPerPage: int(int32), links: [map]?}
@errors {400, 404}

@endpoint GET /api/v2/ActOfParliament
@optional {Id: [str], Name: str}
@returns(200)
@errors {400}

@endpoint GET /api/v2/ActOfParliament/{id}
@required {id: str}
@returns(200) {id: str?, name: str?, link: str?, number: int(int32)?, royalAssent: str(date-time)?, year: int(int32)?}
@errors {404}

@endpoint GET /api/v2/StatutoryInstrument
@optional {Name: str, Procedure: str, ScheduledDebate: bool, MotionToStop: bool, ConcernsRaisedByCommittee: bool, ParliamentaryProcessConcluded: bool, DepartmentId: int(int32), LayingBodyId: str, RecommendedForProcedureChange: bool, ActOfParliamentId: [str], House: str, Skip: int(int32), Take: int(int32)}
@returns(200) {items: [map]?, totalResults: int(int32), itemsPerPage: int(int32), links: [map]?}
@errors {400}

@endpoint GET /api/v2/StatutoryInstrument/{instrumentId}
@required {instrumentId: str}
@returns(200) {value: map{id: str?, name: str?, paperPrefix: str?, paperNumber: int(int32)?, paperYear: str?, procedure: map{id: str?, name: str?}, paperMadeDate: str(date-time)?, commonsLayingDate: str(date-time)?, lordsLayingDate: str(date-time)?, workpackageId: str?, followedByInstrument: map{id: str?, name: str?, procedure: map{id: str?, name: str?}}, precededByInstrument: map{id: str?, name: str?, procedure: map{id: str?, name: str?}}, paperComingIntoForceDate: str(date-time)?, paperComingIntoForceNote: str?, layingBody: map{departmentId: int(int32)?, id: str?, name: str?}, enablingActs: [map]?, timelines: [map]?, link: str?}, links: [map]?}
@errors {400, 404}

@endpoint GET /api/v2/StatutoryInstrument/{instrumentId}/BusinessItems
@required {instrumentId: str}
@returns(200)
@errors {400}

@endpoint GET /api/v2/Timeline/{timelineId}/BusinessItems
@required {timelineId: str}
@returns(200)
@errors {400}

@end
