diff --git a/specification/maps/data-plane/Traffic/readme.md b/specification/maps/data-plane/Traffic/readme.md index b34efd592fe6..22b325aa81ae 100644 --- a/specification/maps/data-plane/Traffic/readme.md +++ b/specification/maps/data-plane/Traffic/readme.md @@ -27,7 +27,7 @@ These are the global settings for Traffic Client. ``` yaml title: TrafficClient openapi-type: data-plane -tag: 1.0-preview +tag: package-2025-01-01 # at some point those credentials will move away to Swagger according to [this](https://github.com/Azure/autorest/issues/3718) add-credentials: true credential-default-policy-type: BearerTokenCredentialPolicy @@ -44,6 +44,19 @@ input-file: - preview/1.0/traffic.json ``` +### Tag: package-2025-01-01 + +These settings apply only when `--tag=package-2025-01-01` is specified on the command line. + +``` yaml $(tag) == 'package-2025-01-01' +input-file: + - stable/2025-01-01/traffic.json + +suppressions: + - code: OperationIdNounVerb + reason: False alarm. Per the Noun_Verb convention for Operation Ids, the noun 'Traffic' should not appear after the underscore. +``` + # Code Generation ## Python diff --git a/specification/maps/data-plane/Traffic/stable/2025-01-01/examples/GetTrafficIncident.json b/specification/maps/data-plane/Traffic/stable/2025-01-01/examples/GetTrafficIncident.json new file mode 100644 index 000000000000..dcebd2b89f57 --- /dev/null +++ b/specification/maps/data-plane/Traffic/stable/2025-01-01/examples/GetTrafficIncident.json @@ -0,0 +1,80 @@ +{ + "parameters": { + "api-version": "2025-01-01", + "bbox": [ + -105, + 37, + -94, + 45 + ] + }, + "responses": { + "200": { + "body": { + "type": "FeatureCollection", + "features": [ + { + "type": "Feature", + "id": 18558549332008001, + "geometry": { + "type": "Point", + "coordinates": [ + -104.939053, + 39.682642 + ] + }, + "properties": { + "startTime": "2025-09-12T09:31:37Z", + "endTime": "2025-09-12T10:21:47Z", + "description": "At CO 2/Colorado Boulevard (Denver) at Mile Point 204. Two right lanes are closed due to a crash.", + "title": "I-25 N / US-87 N", + "incidentType": "Accident", + "severity": 4, + "delay": null, + "lastModifiedTime": "2025-09-12T10:21:47Z", + "endPoint": { + "type": "Point", + "coordinates": [ + -104.940412, + 39.68307 + ] + }, + "isTrafficJam": false, + "isRoadClosed": false + } + }, + { + "type": "Feature", + "id": 21366103288104000, + "geometry": { + "type": "Point", + "coordinates": [ + -94.38411355, + 39.04460549 + ] + }, + "properties": { + "startTime": "2025-09-12T09:42:32Z", + "endTime": "2025-09-12T10:21:47Z", + "description": "Accident on I-70 E from S Lees Summit Rd/Exit 14 (I-70) to I-470/MO-291/Exit 15 (I-70).", + "title": "I-70 E", + "incidentType": "Accident", + "severity": 4, + "delay": 10, + "lastModified": "2025-09-12T10:21:47Z", + "endPoint": { + "type": "Point", + "coordinates": [ + -94.35559355, + 39.04075549 + ] + }, + "isTrafficJam": true, + "isRoadClosed": false + } + } + ] + } + } + } +} diff --git a/specification/maps/data-plane/Traffic/stable/2025-01-01/traffic.json b/specification/maps/data-plane/Traffic/stable/2025-01-01/traffic.json new file mode 100644 index 000000000000..f954e63d4b23 --- /dev/null +++ b/specification/maps/data-plane/Traffic/stable/2025-01-01/traffic.json @@ -0,0 +1,388 @@ +{ + "swagger": "2.0", + "info": { + "title": "Azure Maps Traffic Service", + "version": "2025-01-01", + "description": "Azure Maps Traffic REST APIs" + }, + "host": "atlas.microsoft.com", + "schemes": [ + "https" + ], + "consumes": [], + "produces": [ + "application/json" + ], + "securityDefinitions": { + "AADToken": { + "type": "oauth2", + "authorizationUrl": "https://login.microsoftonline.com/common/oauth2/authorize", + "flow": "implicit", + "description": "These are the [Microsoft Entra OAuth 2.0](https://learn.microsoft.com/en-us/entra/identity-platform/v2-overview) Flows. When paired with [Azure role-based access](https://docs.microsoft.com/azure/role-based-access-control/overview) control it can be used to control access to Azure Maps REST APIs. Azure role-based access controls are used to designate access to one or more Azure Maps resource account or sub-resources. Any user, group, or service principal can be granted access via a built-in role or a custom role composed of one or more permissions to Azure Maps REST APIs.\n\nTo implement scenarios, we recommend viewing [authentication concepts](https://aka.ms/amauth). In summary, this security definition provides a solution for modeling application(s) via objects capable of access control on specific APIs and scopes.\n\n#### Notes\n* This security definition **requires** the use of the `x-ms-client-id` header to indicate which Azure Maps resource the application is requesting access to. This can be acquired from the [Maps management](https://aka.ms/amauthdetails) API.\n* \nThe `Authorization URL` is specific to the Azure public cloud instance. Sovereign clouds have unique Authorization URLs and Microsoft Entra ID configurations. \n* \nThe Azure role-based access control is configured from the [Azure management plane](https://aka.ms/amrbac) via Azure portal, PowerShell, CLI, Azure SDKs, or REST APIs.\n* \nUsage of the [Azure Maps Web SDK](https://aka.ms/amaadmc) allows for configuration based setup of an application for multiple use cases.\n* For more information on Microsoft identity platform, see [Microsoft identity platform overview](https://learn.microsoft.com/entra/identity-platform/v2-overview).", + "scopes": { + "https://atlas.microsoft.com/.default": "https://atlas.microsoft.com/.default" + } + }, + "SharedKey": { + "type": "apiKey", + "description": "This is a shared key that is provisioned when you [Create an Azure Maps account](https://docs.microsoft.com/azure/azure-maps/quick-demo-map-app#create-an-azure-maps-account) in the Azure portal or using PowerShell, CLI, Azure SDKs, or REST API.\n\n With this key, any application can access all REST API. In other words, this key can be used as a master key in the account that they are issued in.\n\n For publicly exposed applications, our recommendation is to use the [confidential client applications](https://docs.microsoft.com/azure/azure-maps/authentication-best-practices#confidential-client-applications) approach to access Azure Maps REST APIs so your key can be securely stored.", + "name": "subscription-key", + "in": "query" + }, + "SasToken": { + "type": "apiKey", + "description": "This is a shared access signature token is created from the List SAS operation on the [Azure Maps resource](https://aka.ms/amauth) through the Azure management plane via Azure portal, PowerShell, CLI, Azure SDKs, or REST APIs.\n\n With this token, any application is authorized to access with Azure role-based access controls and fine-grain control to the expiration, rate, and region(s) of use for the particular token. In other words, the SAS Token can be used to allow applications to control access in a more secured way than the shared key.\n\n For publicly exposed applications, our recommendation is to configure a specific list of allowed origins on the [Map account resource](https://aka.ms/amauth) to limit rendering abuse and regularly renew the SAS Token.", + "name": "SAS Token", + "in": "header" + } + }, + "security": [ + { + "AADToken": [ + "https://atlas.microsoft.com/.default" + ] + }, + { + "SharedKey": [] + }, + { + "SasToken": [] + } + ], + "responses": {}, + "parameters": { + "ApiVersion": { + "name": "api-version", + "description": "Version number of Azure Maps API.", + "type": "string", + "in": "query", + "required": true, + "x-ms-parameter-location": "client" + }, + "Accept-Language": { + "name": "Accept-Language", + "in": "header", + "description": "Language in which traffic incident results should be returned. \n\nFor more information, see [Supported Languages](https://docs.microsoft.com/azure/azure-maps/supported-languages) for reference.", + "required": false, + "type": "string", + "x-ms-parameter-location": "client" + } + }, + "paths": { + "/traffic/incident": { + "get": { + "summary": "The Traffic Incident API provides traffic incidents like construction, traffic congestion and accidents, etc. within a bounding box. It also provides traffic metadata for detailed information about each incident.", + : null, + "description": "\n\nThe API provides a GeoJSON feature collection of traffic incidents. Each incident includes two point features: the location where you encounter the incident and the end location of a traffic incident like the end of a construction zone. For traffic incident coverage by country/region, see [traffic coverage](https://learn.microsoft.com/azure/azure-maps/traffic-coverage). ", + "operationId": "Traffic_GetTrafficIncident", + "x-ms-examples": { + "Request information about a traffic incident": { + "$ref": "./examples/GetTrafficIncident.json" + } + }, + "parameters": [ + { + "$ref": "../../../Common/preview/1.0/common.json#/parameters/ClientId" + }, + { + "$ref": "#/parameters/ApiVersion" + }, + { + "name": "incidentType", + "in": "query", + "description": "Specifies the type of traffic incident to be returned. Multiple incident types within a single request are supported. If not specified, the results will include all incident types within the provided bounding box. \n\nExample, '&incidentType=Accident' or '&incidentType=Accident,Construction'. \n\nWill return all the available incident types if not specified.", + "required": false, + "type": "string", + "enum": [ + "Accident", + "Congestion", + "DisabledVehicle", + "MassTransit", + "Miscellaneous", + "OtherNews", + "PlannedEvent", + "RoadHazard", + "Construction", + "Alert", + "Weather" + ], + "x-ms-enum": { + "name": "IncidentType", + "modelAsString": true, + "values": [ + { + "value": "Accident", + "description": "Accident" + }, + { + "value": "Congestion", + "description": "Congestion" + }, + { + "value": "DisabledVehicle", + "description": "DisabledVehicle" + }, + { + "value": "MassTransit", + "description": "MassTransit" + }, + { + "value": "Miscellaneous", + "description": "Miscellaneous" + }, + { + "value": "OtherNews", + "description": "OtherNews" + }, + { + "value": "PlannedEvent", + "description": "PlannedEvent" + }, + { + "value": "RoadHazard", + "description": "RoadHazard" + }, + { + "value": "Construction", + "description": "Construction" + }, + { + "value": "Alert", + "description": "Alert" + }, + { + "value": "Weather", + "description": "Weather" + } + ] + } + }, + { + "name": "bbox", + "in": "query", + "description": "A rectangular area for the area of interest on the Earth. The sides of the rectangles are defined by longitude and latitude values. It must conform to the GeoJSON format [minLon, minLat, maxLon, maxLat]. For more information, see RFC 7946, Section 5. \n\n The height or width of the bounding box should be at least 12m and not exceed 500,000m. A maximum limit of 30 degrees for either width or height is enforced. (maxLon - minLon should <= 30 and maxLat - minLat should <= 30). \n\nExample: bbox=-105,37,-94,45" + "required": true, + "type": "array", + "items": { + "type": "number", + "format": "double" + }, + "minItems": 4, + "maxItems": 4, + "collectionFormat": "csv" + }, + { + "$ref": "#/parameters/Accept-Language" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/TrafficIncidentResponse" + } + }, + "default": { + "$ref": "../../../Common/stable/2023-06-01/common.json#/responses/default" + } + } + } + } + }, + "definitions": { + "IncidentTypeEnum": { + "type": "string", + "description": "Specifies the type of traffic incident. This can be used to request and differentiate between various types of incidents. ", + "enum": [ + "Accident", + "Congestion", + "DisabledVehicle", + "MassTransit", + "Miscellaneous", + "OtherNews", + "PlannedEvent", + "RoadHazard", + "Construction", + "Alert", + "Weather" + ], + "x-ms-enum": { + "name": "IncidentType", + "modelAsString": true, + "values": [ + { + "value": "Accident", + "description": "Accident" + }, + { + "value": "Congestion", + "description": "Congestion" + }, + { + "value": "DisabledVehicle", + "description": "DisabledVehicle" + }, + { + "value": "MassTransit", + "description": "MassTransit" + }, + { + "value": "Miscellaneous", + "description": "Miscellaneous" + }, + { + "value": "OtherNews", + "description": "OtherNews" + }, + { + "value": "PlannedEvent", + "description": "PlannedEvent" + }, + { + "value": "RoadHazard", + "description": "RoadHazard" + }, + { + "value": "Construction", + "description": "Construction" + }, + { + "value": "Alert", + "description": "Alert" + }, + { + "value": "Weather", + "description": "Weather" + } + ] + } + }, + "FeatureTypeEnum": { + "type": "string", + "description": "Specifies the `GeoJSON` type. The only supported object type is `FeatureCollection`. For more information, see [RFC 7946](https://www.rfc-editor.org/rfc/rfc7946).", + "enum": [ + "FeatureCollection" + ], + "x-ms-enum": { + "name": "FeatureTypeEnum", + "modelAsString": true, + "values": [ + { + "value": "FeatureCollection", + "description": "Specifies the `GeoJSON` `FeatureCollection` object type." + } + ] + } + }, + "FeaturesItemTypeEnum": { + "type": "string", + "description": "Specifies the `GeoJSON` type. The only supported object type is Feature. For more information, see [RFC 7946](https://www.rfc-editor.org/rfc/rfc7946).", + "enum": [ + "Feature" + ], + "x-ms-enum": { + "name": "FeaturesItemTypeEnum", + "modelAsString": true, + "values": [ + { + "value": "Feature", + "description": "Specifies the `GeoJSON` Feature object type." + } + ] + } + }, + "TrafficIncidentFeatureProperties": { + "description": "Specifies detailed information about the traffic incidents.", + "type": "object", + "properties": { + "description": { + "description": "A description of the incident that includes the road name and the event impacting the traffic flow. \n\n Examples: \n\n• W 95th St between Switzer Rd and Bluejacket Dr - construction \n\n• WB Johnson Dr at I-435 - bridge repair", + "type": "string" + }, + "startTime": { + "description": "The date and time in UTC when the incident occurred, formatted as a dateTime value as defined in [RFC 3339, section 5.6](https://www.rfc-editor.org/rfc/rfc3339#section-5.6).", + "type": "string" + }, + "endTime": { + "description": "The date and time in UTC when the traffic incident will end, formatted as a dateTime value as defined in [RFC 3339, section 5.6](https://www.rfc-editor.org/rfc/rfc3339#section-5.6).", + "type": "string" + }, + "lastModifiedTime": { + "description": "The date and time in UTC when the incident information was last updated, formatted as a dateTime value as defined in [RFC 3339, section 5.6](https://www.rfc-editor.org/rfc/rfc3339#section-5.6).", + "type": "string" + }, + "isRoadClosed": { + "description": "A value of `true` indicates that there is a road closure.", + "type": "boolean" + }, + "severity": { + "description": "Specifies the level of importance of the incident.\n\n - 1: LowImpact \n\n - 2: Minor \n\n - 3: Moderate \n\n- 4: Serious", + "type": "integer", + "format": "int32" + }, + "incidentType": { + "$ref": "#/definitions/IncidentTypeEnum" + }, + "title": { + "description": "Specifies the road names and direction of affected roads.", + "type": "string" + }, + "delay": { + "description": "The delay caused by the incident in seconds. If no delay or not applicable, it returns zero.", + "type": "number", + "format": "double" + }, + "endPoint": { + "description": "A GeoJson Point object that specified the end location of a traffic incident such as end of a construction zone. \n\n This location is part of the incident properties object and by default, cannot be interpreted by parsers for display on the map.", + "type": "object" + }, + "isTrafficJam": { + "description": "A value of `true` indicates that the area of road covered by this incident is experiencing abnormal traffic conditions resulting in non-typical delays.", + "type": "boolean" + } + } + }, + "TrafficIncidentFeaturesItem": { + "type": "object", + "description": "Specifies the traffic incident GeoJSON feature object including the geometry and additional properties.", + "allOf": [ + { + "type": "object", + "description": "GeoJSON feature object that contains Geometry object and additional properties of traffic incidents.", + "properties": { + "type": { + "$ref": "#/definitions/FeaturesItemTypeEnum" + }, + "id": { + "description": "A unique ID for the incident.", + "type": "integer", + "format": "int64" + }, + "geometry": { + "$ref": "../../../Common/preview/1.0/common.json#/definitions/GeoJsonPoint" + }, + "properties": { + "$ref": "#/definitions/TrafficIncidentFeatureProperties" + } + } + } + ] + }, + "TrafficIncidentResponse": { + "description": "A GeoJSON feature collection object that contains a list of traffic incidents features.", + "type": "object", + "properties": { + "type": { + "$ref": "#/definitions/FeatureTypeEnum" + }, + "features": { + "type": "array", + "description": "`GeoJSON` feature object that contains Geometry object and additional properties. Refer to [RFC 7946, Section 3.2](https://www.rfc-editor.org/rfc/rfc7946#section-3.2) for details.", + "items": { + "$ref": "#/definitions/TrafficIncidentFeaturesItem" + } + } + } + } + } +} diff --git a/specification/maps/suppressions.yaml b/specification/maps/suppressions.yaml index 431e06fcfa75..f639a1c12e32 100644 --- a/specification/maps/suppressions.yaml +++ b/specification/maps/suppressions.yaml @@ -13,3 +13,6 @@ - tool: TypeSpecRequirement path: ./data-plane/Route/stable/2025-01-01/route.json reason: Brownfield service not ready to migrate +- tool: TypeSpecRequirement + path: ./data-plane/Traffic/stable/2025-01-01/traffic.json + reason: Brownfield service not ready to migrate