{
	"openapi": "3.0.0",
	"components": {
		"examples": {},
		"headers": {},
		"parameters": {},
		"requestBodies": {},
		"responses": {},
		"schemas": {
			"SampleInspectionQuotaResponse": {
				"properties": {
					"quota": {
						"type": "number",
						"format": "double"
					}
				},
				"required": [
					"quota"
				],
				"type": "object",
				"additionalProperties": false
			},
			"GenerateSampleInspectionsRequest": {
				"properties": {
					"sample_inspection_rate": {
						"type": "number",
						"format": "double",
						"description": "See API specification Resource Guide > Sampling API > Sample inspections for more information"
					}
				},
				"required": [
					"sample_inspection_rate"
				],
				"type": "object",
				"additionalProperties": false
			},
			"SampleInspectionTargetCreateResponse": {
				"properties": {
					"sample_inspection_target_reference_number": {
						"type": "string"
					}
				},
				"required": [
					"sample_inspection_target_reference_number"
				],
				"type": "object",
				"additionalProperties": false
			},
			"AnnualInspectionUnitsSummary": {
				"properties": {
					"financial_year_start_date": {
						"type": "string",
						"format": "date-time"
					},
					"annual_inspection_units": {
						"type": "number",
						"format": "double",
						"nullable": true
					},
					"is_auto_calculated": {
						"type": "boolean"
					}
				},
				"required": [
					"financial_year_start_date",
					"is_auto_calculated"
				],
				"type": "object",
				"additionalProperties": false
			},
			"SampleInspectionTargetCreateRequest": {
				"properties": {
					"internal_user_identifier": {
						"type": "string",
						"nullable": true,
						"description": "Max length 100 characters"
					},
					"internal_user_name": {
						"type": "string",
						"nullable": true,
						"description": "Max length 50 characters"
					},
					"inspection_units_baseline": {
						"type": "number",
						"format": "double",
						"nullable": true,
						"description": "Required if annual_inspection_units not provided\nMust be whole number"
					},
					"annual_inspection_units": {
						"items": {
							"$ref": "#/components/schemas/AnnualInspectionUnitsSummary"
						},
						"type": "array",
						"nullable": true,
						"description": "Required if inspection_units_baseline not provided"
					},
					"inspection_rate": {
						"type": "number",
						"format": "double",
						"description": "Must be between 20 and 100"
					},
					"target_a": {
						"type": "number",
						"format": "double",
						"description": "Sum of target_a + target_b + target_c must not exceed the quarterly quota\nMust be whole number\nSee API specification Resource Guide > Sampling API > Sample inspection quota for more information"
					},
					"target_b": {
						"type": "number",
						"format": "double",
						"description": "Sum of target_a + target_b + target_c must not exceed the quarterly quota\nMust be whole number\nSee API specification Resource Guide > Sampling API > Sample inspection quota for more information"
					},
					"target_c": {
						"type": "number",
						"format": "double",
						"description": "Sum of target_a + target_b + target_c must not exceed the quarterly quota\nMust be whole number\nSee API specification Resource Guide > Sampling API > Sample inspection quota for more information"
					},
					"promoter_org_ref": {
						"type": "string",
						"description": "Max length 4 characters"
					}
				},
				"required": [
					"inspection_rate",
					"target_a",
					"target_b",
					"target_c",
					"promoter_org_ref"
				],
				"type": "object",
				"additionalProperties": false
			},
			"SampleInspectionTargetUpdateRequest": {
				"properties": {
					"internal_user_identifier": {
						"type": "string",
						"nullable": true,
						"description": "Max length 100 characters"
					},
					"internal_user_name": {
						"type": "string",
						"nullable": true,
						"description": "Max length 50 characters"
					},
					"inspection_units_baseline": {
						"type": "number",
						"format": "double",
						"nullable": true,
						"description": "Required if annual_inspection_units not provided\nMust be whole number"
					},
					"annual_inspection_units": {
						"items": {
							"$ref": "#/components/schemas/AnnualInspectionUnitsSummary"
						},
						"type": "array",
						"nullable": true,
						"description": "Required if inspection_units_baseline not provided"
					},
					"inspection_rate": {
						"type": "number",
						"format": "double",
						"description": "Must be between 20 and 100"
					},
					"target_a": {
						"type": "number",
						"format": "double",
						"description": "Sum of target_a + target_b + target_c must not exceed the quarterly quota\nMust be whole number\nSee API specification Resource Guide > Sampling API > Sample inspection quota for more information"
					},
					"target_b": {
						"type": "number",
						"format": "double",
						"description": "Sum of target_a + target_b + target_c must not exceed the quarterly quota\nMust be whole number\nSee API specification Resource Guide > Sampling API > Sample inspection quota for more information"
					},
					"target_c": {
						"type": "number",
						"format": "double",
						"description": "Sum of target_a + target_b + target_c must not exceed the quarterly quota\nMust be whole number\nSee API specification Resource Guide > Sampling API > Sample inspection quota for more information"
					}
				},
				"required": [
					"inspection_rate",
					"target_a",
					"target_b",
					"target_c"
				],
				"type": "object",
				"additionalProperties": false
			},
			"SampleInspectionTargetResponse": {
				"properties": {
					"sample_inspection_target_reference_number": {
						"type": "string"
					},
					"org_ref": {
						"type": "string"
					},
					"organisation_name": {
						"type": "string"
					},
					"yearly_inspection_units": {
						"type": "number",
						"format": "double"
					},
					"inspection_rate": {
						"type": "number",
						"format": "double"
					},
					"target_a": {
						"type": "number",
						"format": "double"
					},
					"target_b": {
						"type": "number",
						"format": "double"
					},
					"target_c": {
						"type": "number",
						"format": "double"
					},
					"completed_a": {
						"type": "number",
						"format": "double"
					},
					"completed_b": {
						"type": "number",
						"format": "double"
					},
					"completed_c": {
						"type": "number",
						"format": "double"
					},
					"generated_b": {
						"type": "number",
						"format": "double"
					},
					"generated_c": {
						"type": "number",
						"format": "double"
					}
				},
				"required": [
					"sample_inspection_target_reference_number",
					"org_ref",
					"organisation_name",
					"yearly_inspection_units",
					"inspection_rate",
					"target_a",
					"target_b",
					"target_c",
					"completed_a",
					"completed_b",
					"completed_c",
					"generated_b",
					"generated_c"
				],
				"type": "object",
				"additionalProperties": false
			},
			"SampleInspectionStartQuarterRequest": {
				"properties": {
					"internal_user_identifier": {
						"type": "string",
						"nullable": true,
						"description": "Max length 100 characters"
					},
					"internal_user_name": {
						"type": "string",
						"nullable": true,
						"description": "Max length 50 characters"
					},
					"start_date": {
						"type": "string",
						"format": "date-time",
						"description": "Must be a valid financial quarter start date"
					}
				},
				"required": [
					"start_date"
				],
				"type": "object",
				"additionalProperties": false
			},
			"AnnualInspectionUnitsResponse": {
				"properties": {
					"annual_inspection_units": {
						"items": {
							"$ref": "#/components/schemas/AnnualInspectionUnitsSummary"
						},
						"type": "array"
					}
				},
				"required": [
					"annual_inspection_units"
				],
				"type": "object",
				"additionalProperties": false
			}
		},
		"securitySchemes": {
			"token": {
				"type": "apiKey",
				"name": "token",
				"in": "header"
			}
		}
	},
	"info": {
		"title": "Street Manager Sampling API",
		"version": "1.0.0",
		"description": "See API specification Resource Guide > Sampling API for more information on endpoints\nNOTE: Swagger Editor/UI does not display all description text for enumerations and child elements, check swagger.json for full description text",
		"license": {
			"name": "MIT"
		},
		"contact": {}
	},
	"paths": {
		"/sample-inspection-quota": {
			"get": {
				"operationId": "GetSampleInspectionQuota",
				"responses": {
					"200": {
						"description": "Ok",
						"content": {
							"application/json": {
								"schema": {
									"$ref": "#/components/schemas/SampleInspectionQuotaResponse"
								}
							}
						}
					}
				},
				"security": [
					{
						"token": [
							"Admin",
							"StreetWorksAdmin"
						]
					}
				],
				"parameters": [
					{
						"in": "query",
						"name": "inspection_units",
						"required": true,
						"schema": {
							"type": "array",
							"items": {
								"type": "number",
								"format": "double"
							}
						}
					},
					{
						"in": "query",
						"name": "inspection_rate",
						"required": true,
						"schema": {
							"format": "double",
							"type": "number"
						}
					}
				]
			}
		},
		"/sample-inspections": {
			"post": {
				"operationId": "GenerateSampleInspections",
				"responses": {
					"204": {
						"description": "No content"
					}
				},
				"security": [
					{
						"token": [
							"Admin",
							"StreetWorksAdmin"
						]
					}
				],
				"parameters": [],
				"requestBody": {
					"required": true,
					"content": {
						"application/json": {
							"schema": {
								"$ref": "#/components/schemas/GenerateSampleInspectionsRequest"
							}
						}
					}
				}
			}
		},
		"/sample-inspection-targets": {
			"post": {
				"operationId": "CreateSampleInspectionTarget",
				"responses": {
					"201": {
						"description": "Created",
						"content": {
							"application/json": {
								"schema": {
									"$ref": "#/components/schemas/SampleInspectionTargetCreateResponse"
								}
							}
						}
					}
				},
				"security": [
					{
						"token": [
							"Admin",
							"StreetWorksAdmin"
						]
					}
				],
				"parameters": [],
				"requestBody": {
					"required": true,
					"content": {
						"application/json": {
							"schema": {
								"$ref": "#/components/schemas/SampleInspectionTargetCreateRequest"
							}
						}
					}
				}
			}
		},
		"/sample-inspection-targets/{sampleInspectionTargetReferenceNumber}": {
			"delete": {
				"operationId": "DeleteSampleInspectionTarget",
				"responses": {
					"204": {
						"description": "No Content"
					}
				},
				"security": [
					{
						"token": [
							"Admin",
							"StreetWorksAdmin"
						]
					}
				],
				"parameters": [
					{
						"in": "path",
						"name": "sampleInspectionTargetReferenceNumber",
						"required": true,
						"schema": {
							"type": "string"
						}
					}
				]
			},
			"put": {
				"operationId": "UpdateSampleInspectionTarget",
				"responses": {
					"204": {
						"description": "No Content"
					}
				},
				"security": [
					{
						"token": [
							"Admin",
							"StreetWorksAdmin"
						]
					}
				],
				"parameters": [
					{
						"in": "path",
						"name": "sampleInspectionTargetReferenceNumber",
						"required": true,
						"schema": {
							"type": "string"
						}
					}
				],
				"requestBody": {
					"required": true,
					"content": {
						"application/json": {
							"schema": {
								"$ref": "#/components/schemas/SampleInspectionTargetUpdateRequest"
							}
						}
					}
				}
			},
			"get": {
				"operationId": "GetSampleInspectionTarget",
				"responses": {
					"200": {
						"description": "Ok",
						"content": {
							"application/json": {
								"schema": {
									"$ref": "#/components/schemas/SampleInspectionTargetResponse"
								}
							}
						}
					}
				},
				"security": [
					{
						"token": [
							"Admin",
							"StreetWorksAdmin"
						]
					}
				],
				"parameters": [
					{
						"in": "path",
						"name": "sampleInspectionTargetReferenceNumber",
						"required": true,
						"schema": {
							"type": "string"
						}
					}
				]
			}
		},
		"/sample-inspections/start-quarter": {
			"post": {
				"operationId": "StartQuarter",
				"responses": {
					"204": {
						"description": "No content"
					}
				},
				"security": [
					{
						"token": [
							"Admin",
							"StreetWorksAdmin"
						]
					}
				],
				"parameters": [],
				"requestBody": {
					"required": true,
					"content": {
						"application/json": {
							"schema": {
								"$ref": "#/components/schemas/SampleInspectionStartQuarterRequest"
							}
						}
					}
				}
			}
		},
		"/sample-inspections/end-quarter": {
			"post": {
				"operationId": "EndQuarter",
				"responses": {
					"204": {
						"description": "No content"
					}
				},
				"security": [
					{
						"token": [
							"Admin",
							"StreetWorksAdmin"
						]
					}
				],
				"parameters": []
			}
		},
		"/sample-inspections/revert-end-quarter": {
			"post": {
				"operationId": "RevertEndQuarter",
				"responses": {
					"204": {
						"description": "No content"
					}
				},
				"security": [
					{
						"token": [
							"Admin",
							"StreetWorksAdmin"
						]
					}
				],
				"parameters": []
			}
		},
		"/previous-annual-inspection-units": {
			"get": {
				"operationId": "GetPreviousAnnualInspectionUnits",
				"responses": {
					"200": {
						"description": "Ok",
						"content": {
							"application/json": {
								"schema": {
									"$ref": "#/components/schemas/AnnualInspectionUnitsResponse"
								}
							}
						}
					}
				},
				"security": [
					{
						"token": [
							"Admin",
							"StreetWorksAdmin"
						]
					}
				],
				"parameters": [
					{
						"in": "query",
						"name": "promoter_org_ref",
						"required": true,
						"schema": {
							"type": "string"
						}
					},
					{
						"in": "query",
						"name": "financial_year_start_date",
						"required": false,
						"schema": {
							"format": "date-time",
							"type": "string"
						}
					}
				]
			}
		}
	},
	"servers": [
		{
			"url": "/"
		}
	]
}