diff --git a/sdk/maps/Azure.Maps.Weather/src/Generated/IWeatherClient.cs b/sdk/maps/Azure.Maps.Weather/src/Generated/IWeatherClient.cs new file mode 100644 index 000000000000..71be4f332ac7 --- /dev/null +++ b/sdk/maps/Azure.Maps.Weather/src/Generated/IWeatherClient.cs @@ -0,0 +1,64 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Azure.Maps.Weather +{ + using Microsoft.Rest; + using Models; + using Newtonsoft.Json; + + /// + /// + public partial interface IWeatherClient : System.IDisposable + { + /// + /// The base URI of the service. + /// + System.Uri BaseUri { get; set; } + + /// + /// Gets or sets json serialization settings. + /// + JsonSerializerSettings SerializationSettings { get; } + + /// + /// Gets or sets json deserialization settings. + /// + JsonSerializerSettings DeserializationSettings { get; } + + /// + /// Version number of Azure Maps API. + /// + string ApiVersion { get; set; } + + /// + /// Specifies which account is intended for usage in conjunction with + /// the Azure AD security model. It represents a unique ID for the + /// Azure Maps account and can be retrieved from the Azure Maps + /// management plane Account API. To use Azure AD security in Azure + /// Maps see the following [articles](https://aka.ms/amauthdetails) for + /// guidance. + /// + string ClientId { get; set; } + + /// + /// Subscription credentials which uniquely identify client + /// subscription. + /// + ServiceClientCredentials Credentials { get; } + + + /// + /// Gets the IWeatherOperations. + /// + IWeatherOperations Weather { get; } + + } +} diff --git a/sdk/maps/Azure.Maps.Weather/src/Generated/IWeatherOperations.cs b/sdk/maps/Azure.Maps.Weather/src/Generated/IWeatherOperations.cs new file mode 100644 index 000000000000..13a6e5d4edcf --- /dev/null +++ b/sdk/maps/Azure.Maps.Weather/src/Generated/IWeatherOperations.cs @@ -0,0 +1,1033 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Azure.Maps.Weather +{ + using Microsoft.Rest; + using Models; + using System.Collections; + using System.Collections.Generic; + using System.Threading; + using System.Threading.Tasks; + + /// + /// WeatherOperations operations. + /// + public partial interface IWeatherOperations + { + /// + /// **Get Hourly Forecast** + /// + /// **Applies to**: see pricing + /// [tiers](https://aka.ms/AzureMapsPricingTier). + /// + /// Request detailed weather forecast by the hour for the next 1, 12, + /// 24 (1 day), 72 (3 days), 120 (5 days), and 240 hours (10 days) for + /// the given the given coordinate location. The API returns details + /// such as temperature, humidity, wind, precipitation, and ultraviolet + /// (UV) index. + /// + /// In S0 you can request hourly forecast for the next 1, 12, 24 hours + /// (1 day), and 72 hours (3 days). In S1 you can also request hourly + /// forecast for the next 120 (5 days) and 240 hours (10 days). + /// + /// + /// The applicable query specified as a comma separated string composed + /// by latitude followed by longitude e.g. "47.641268,-122.125679". + /// + /// + /// Specifies to return the data in either metric units or imperial + /// units. Default value is metric. Possible values include: 'metric', + /// 'imperial' + /// + /// + /// Time frame of the returned weather forecast. By default, the + /// forecast data for next hour will be returned. Available values are + /// * `1` - Return forecast data for the next hour. Default value. + /// * `12` - Return hourly forecast for next 12 hours. + /// * `24` - Return hourly forecast for next 24 hours. + /// * `72` - Return hourly forecast for next 72 hours (3 days). + /// * `120` - Return hourly forecast for next 120 hours (5 days). Only + /// available in S1 SKU. + /// * `240` - Return hourly forecast for next 240 hours (10 days). Only + /// available in S1 SKU. + /// + /// + /// Language in which search results should be returned. Should be one + /// of supported IETF language tags, case insensitive. When data in + /// specified language is not available for a specific field, default + /// language is used. + /// + /// Please refer to [Supported + /// Languages](https://docs.microsoft.com/azure/azure-maps/supported-languages) + /// for details. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> GetHourlyForecastWithHttpMessagesAsync(IList coordinates, string unit = default(string), int? duration = default(int?), string language = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// **Get Minute Forecast** + /// + /// + /// **Applies to**: see pricing + /// [tiers](https://aka.ms/AzureMapsPricingTier). + /// + /// + /// Get Minute Forecast service returns minute-by-minute forecasts for + /// a given location for the next 120 minutes. Users can request + /// weather forecasts in the interval of 1, 5 and 15 minutes. The + /// response will include details such as the type of precipitation + /// (including rain, snow, or a mixture of both), start time, and + /// precipitation intensity value (dBZ). + /// + /// + /// The applicable query specified as a comma separated string composed + /// by latitude followed by longitude e.g. "47.641268,-122.125679". + /// + /// + /// Specifies time interval in minutes for the returned weather + /// forecast. Supported values are + /// * `1` - Retrieve forecast for 1-minute intervals. Returned by + /// default. + /// * `5` - Retrieve forecasts for 5-minute intervals. + /// * `15` - Retrieve forecasts for 15-minute intervals. + /// + /// + /// Language in which search results should be returned. Should be one + /// of supported IETF language tags, case insensitive. When data in + /// specified language is not available for a specific field, default + /// language is used. + /// + /// Please refer to [Supported + /// Languages](https://docs.microsoft.com/azure/azure-maps/supported-languages) + /// for details. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> GetMinuteForecastWithHttpMessagesAsync(IList coordinates, int? interval = default(int?), string language = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// **Get Quarter-Day Forecast** + /// + /// + /// **Applies to**: see pricing + /// [tiers](https://aka.ms/AzureMapsPricingTier). + /// + /// + /// Service returns detailed weather forecast by quarter-day for the + /// next 1, 5, 10, or 15 days for a given location. Response data is + /// presented by quarters of the day - morning, afternoon, evening, and + /// overnight. Details such as temperature, humidity, wind, + /// precipitation, and UV index are returned. + /// + /// + /// The applicable query specified as a comma separated string composed + /// by latitude followed by longitude e.g. "47.641268,-122.125679". + /// + /// + /// Specifies to return the data in either metric units or imperial + /// units. Default value is metric. Possible values include: 'metric', + /// 'imperial' + /// + /// + /// Specifies for how many days the quester-day forecast responses are + /// returned. Supported values are: + /// * `1` - Return forecast data for the next day. Returned by default. + /// * `5` - Return forecast data for the next 5 days. + /// * `10` - Return forecast data for next 10 days. + /// * `15` - Return forecast data for the next 15 days. + /// + /// + /// Language in which search results should be returned. Should be one + /// of supported IETF language tags, case insensitive. When data in + /// specified language is not available for a specific field, default + /// language is used. + /// + /// Please refer to [Supported + /// Languages](https://docs.microsoft.com/azure/azure-maps/supported-languages) + /// for details. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> GetQuarterDayForecastWithHttpMessagesAsync(IList coordinates, string unit = default(string), int? duration = default(int?), string language = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// **Get Current Conditions** + /// + /// + /// **Applies to**: see pricing + /// [tiers](https://aka.ms/AzureMapsPricingTier). + /// + /// + /// Get Current Conditions service returns detailed current weather + /// conditions such as precipitation, temperature and wind for a given + /// coordinate location. Also, observations from the past 6 or 24 hours + /// for a particular location can be retrieved. The basic information + /// returned with the response include details such as observation date + /// and time, brief description of the weather conditions, weather + /// icon, precipitation indicator flags, and temperature. Additional + /// details such as RealFeel™ Temperature and UV index are also + /// returned. + /// + /// + /// The applicable query specified as a comma separated string composed + /// by latitude followed by longitude e.g. "47.641268,-122.125679". + /// + /// + /// Specifies to return the data in either metric units or imperial + /// units. Default value is metric. Possible values include: 'metric', + /// 'imperial' + /// + /// + /// Return full details for the current conditions. Available values + /// are + /// * `true` - Returns full details. By default all details are + /// returned. + /// * `false` - Returns a truncated version of the current condition + /// data, which includes observation date time, weather phrase, icon + /// code, precipitation indicator flag, and temperature. + /// + /// + /// Time frame of the returned weather conditions. By default, the most + /// current weather conditions will be returned. Default value is 0. + /// Supported values are: + /// * `0` - Return the most current weather conditions. + /// * `6` - Return weather conditions from past 6 hours. + /// * `24` - Return weather conditions from past 24 hours. + /// + /// + /// Language in which search results should be returned. Should be one + /// of supported IETF language tags, case insensitive. When data in + /// specified language is not available for a specific field, default + /// language is used. + /// + /// Please refer to [Supported + /// Languages](https://docs.microsoft.com/azure/azure-maps/supported-languages) + /// for details. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> GetCurrentConditionsWithHttpMessagesAsync(IList coordinates, string unit = default(string), string details = default(string), int? duration = default(int?), string language = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// **Get Daily Forecast** + /// + /// + /// **Applies to**: see pricing + /// [tiers](https://aka.ms/AzureMapsPricingTier). + /// + /// + /// The service returns detailed weather forecast such as temperature + /// and wind by day for the next 1, 5, 10, 15, 25, or 45 days for a + /// given coordinate location. The response include details such as + /// temperature, wind, precipitation, air quality, and UV index. + /// + /// In S0 you can request daily forecast for the next 1, 5, 10, and 15 + /// days. In S1 you can also request daily forecast for the next 25 + /// days, and 45 days. + /// + /// + /// The applicable query specified as a comma separated string composed + /// by latitude followed by longitude e.g. "47.641268,-122.125679". + /// + /// + /// Specifies to return the data in either metric units or imperial + /// units. Default value is metric. Possible values include: 'metric', + /// 'imperial' + /// + /// + /// Specifies for how many days the daily forecast responses are + /// returned. Available values are + /// * `1` - Return forecast data for the next day. Returned by default. + /// * `5` - Return forecast data for the next 5 days. + /// * `10` - Return forecast data for the next 10 days. + /// * `25` - Return forecast data for the next 25 days. Only available + /// in S1 SKU. + /// * `45` - Return forecast data for the next 45 days. Only available + /// in S1 SKU. + /// + /// + /// Language in which search results should be returned. Should be one + /// of supported IETF language tags, case insensitive. When data in + /// specified language is not available for a specific field, default + /// language is used. + /// + /// Please refer to [Supported + /// Languages](https://docs.microsoft.com/azure/azure-maps/supported-languages) + /// for details. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> GetDailyForecastWithHttpMessagesAsync(IList coordinates, string unit = default(string), int? duration = default(int?), string language = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// **Get Weather along route** + /// + /// + /// **Applies to**: see pricing + /// [tiers](https://aka.ms/AzureMapsPricingTier). + /// + /// Weather along a route API returns hyper local (one kilometer or + /// less), up-to-the-minute weather nowcasts, weather hazard + /// assessments, and notifications along a route described as a + /// sequence of waypoints. + /// This includes a list of weather hazards affecting the waypoint or + /// route, and the aggregated hazard index for each waypoint might be + /// used to paint each portion of a route according to how safe it is + /// for the driver. When submitting the waypoints, it is recommended to + /// stay within, or close to, the distance that can be traveled within + /// 120-mins or shortly after. Data is updated every five minutes. + /// + /// The service supplements Azure Maps [Route + /// Service](https://docs.microsoft.com/rest/api/maps/route) that + /// allows you to first request a route between an origin and a + /// destination and use that as an input for Weather Along Route + /// endpoint. + /// + /// In addition, the service supports scenarios to generate weather + /// notifications for waypoints that experience an increase in + /// intensity of a weather hazard. For example, if the vehicle is + /// expected to begin experiencing heavy rain as it reaches a waypoint, + /// a weather notification for heavy rain will be generated for that + /// waypoint allowing the end product to display a heavy rain + /// notification before the driver reaches that waypoint. + /// The trigger for when to display the notification for a waypoint + /// could be based, for example, on a + /// [geofence](https://docs.microsoft.com/azure/azure-maps/tutorial-iot-hub-maps), + /// or selectable distance to the waypoint. + /// + /// The API covers all regions of the planet except latitudes above + /// Greenland and Antarctica. + /// + /// + /// Coordinates through which the route is calculated, separated by + /// colon (:) and entered in chronological order. A minimum of two + /// waypoints is required. A single API call may contain up to 60 + /// waypoints. + /// A waypoint indicates location, ETA, and optional heading: + /// latitude,longitude,ETA,heading, where + /// * `Latitude` - Latitude coordinate in decimal degrees. + /// * `Longitude` - Longitude coordinate in decimal degrees. + /// * `ETA (estimated time of arrival)` - The number of minutes from + /// the present time that it will take for the vehicle to reach the + /// waypoint. Allowed range is from 0.0 to 120.0 minutes. + /// * `Heading` - An optional value indicating the vehicle heading as + /// it passes the waypoint. Expressed in clockwise degrees relative to + /// true north. This is issued to calculate sun glare as a driving + /// hazard. Allowed range is from 0.0 to 360.0 degrees. If not + /// provided, a heading will automatically be derived based on the + /// position of neighboring waypoints. + /// + /// It is recommended to stay within, or close to, the distance that + /// can be traveled within 120-mins or shortly after. This way a more + /// accurate assessment can be provided for the trip and prevent + /// isolated events not being captured between waypoints. Information + /// can and should be updated along the route (especially for trips + /// greater than 2 hours) to continuously pull new waypoints moving + /// forward, but also to ensure that forecast information for content + /// such as precipitation type and intensity is accurate as storms + /// develop and dissipate over time. + /// + /// + /// Language in which search results should be returned. Should be one + /// of supported IETF language tags, case insensitive. When data in + /// specified language is not available for a specific field, default + /// language is used. + /// + /// Please refer to [Supported + /// Languages](https://docs.microsoft.com/azure/azure-maps/supported-languages) + /// for details. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> GetWeatherAlongRouteWithHttpMessagesAsync(string query, string language = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// **Get Severe Weather Alerts** + /// + /// **Applies to**: see pricing + /// [tiers](https://aka.ms/AzureMapsPricingTier). + /// + /// Severe weather phenomenon can significantly impact our everyday + /// life and business operations. For example, severe weather + /// conditions such as tropical storms, high winds or flooding can + /// close roads and force logistics companies to reroute their fleet + /// causing delays in reaching destinations and breaking the cold chain + /// of refrigerated food products.  Azure Maps Severe Weather Alerts + /// API returns the severe weather alerts that are available worldwide + /// from both official Government Meteorological Agencies and leading + /// global to regional weather alert providers. The service can return + /// details such as alert type, category, level and detailed + /// description about the active severe alerts for the requested + /// location, like hurricanes, thunderstorms, lightning, heat waves or + /// forest fires. + /// + /// + /// The applicable query specified as a comma separated string composed + /// by latitude followed by longitude e.g. "47.641268,-122.125679". + /// + /// + /// Language in which search results should be returned. Should be one + /// of supported IETF language tags, case insensitive. When data in + /// specified language is not available for a specific field, default + /// language is used. + /// + /// Please refer to [Supported + /// Languages](https://docs.microsoft.com/azure/azure-maps/supported-languages) + /// for details. + /// + /// + /// Return full details for the severe weather alerts. Available values + /// are + /// * `true` - Returns full details. By default all details are + /// returned. + /// * `false` - Returns a truncated version of the alerts data, which + /// excludes the area-specific full description of alert details + /// (`alertDetails`). + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> GetSevereWeatherAlertsWithHttpMessagesAsync(IList coordinates, string language = default(string), string details = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// **Get Daily Indices** + /// + /// **Applies to**: see pricing + /// [tiers](https://aka.ms/AzureMapsPricingTier). + /// + /// There may be times when you want to know if the weather conditions + /// are optimal for a specific activity, for example, for outdoor + /// construction, indoor activities, running or farming including soil + /// moisture information. Azure Maps Indices API returns index values + /// that will guide end users to plan future activities. For example, a + /// health mobile application can notify users that today is good + /// weather for running or for other outdoors activities like for + /// playing golf, and retail stores can optimize their digital + /// marketing campaigns based on predicted index values. The service + /// returns in daily indices values for current and next 5, 10 and 15 + /// days starting from current day. + /// + /// + /// The applicable query specified as a comma separated string composed + /// by latitude followed by longitude e.g. "47.641268,-122.125679". + /// + /// + /// Language in which search results should be returned. Should be one + /// of supported IETF language tags, case insensitive. When data in + /// specified language is not available for a specific field, default + /// language is used. + /// + /// Please refer to [Supported + /// Languages](https://docs.microsoft.com/azure/azure-maps/supported-languages) + /// for details. + /// + /// + /// Specifies for how many days the daily indices are returned. By + /// default, the indices data for the current day will be returned. + /// When requesting future indices data, the current day is included in + /// the response as day 1. Available values are + /// * `1` - Return daily index data for the current day. Default value. + /// * `5` - Return 5 days of daily index data starting from the current + /// day. + /// * `10` - Return 10 days of daily index data starting from the + /// current day. + /// * `15` - Return 15 days of daily index data starting from the + /// current day. + /// + /// + /// Numeric index identifier that can be used for restricting returned + /// results to the corresponding index type. Cannot be paired with + /// `indexGroupId`. Please refer to [Weather Service + /// Concepts](https://aka.ms/AzureMapsWeatherConcepts) for details and + /// to see the supported indices. + /// + /// + /// Numeric index group identifier that can be used for restricting + /// returned results to the corresponding subset of indices (index + /// group). Cannot be paired with `indexId`. Please refer to [Weather + /// Service Concepts](https://aka.ms/AzureMapsWeatherConcepts) for + /// details and to see the supported index groups. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> GetDailyIndicesWithHttpMessagesAsync(IList coordinates, string language = default(string), int? duration = default(int?), int? indexId = default(int?), int? indexGroupId = default(int?), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// **Get Tropical Storm Active** + /// + /// **Applies to**: see pricing + /// [tiers](https://aka.ms/AzureMapsPricingTier). + /// + /// Get all government-issued active tropical storms. Information about + /// the tropical storms includes, government ID, basin ID, year of + /// origin, name and if it is subtropical. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> GetTropicalStormActiveWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// **Get Tropical Storm Search** + /// + /// **Applies to**: see pricing + /// [tiers](https://aka.ms/AzureMapsPricingTier). + /// + /// Search government-issued tropical storms by year, basin ID, and + /// government ID. Information about the tropical storms includes, + /// government ID, basin ID, status, year, name and if it is + /// subtropical. + /// + /// + /// Year of the cyclone(s) + /// + /// + /// Basin identifier. Possible values include: 'AL', 'EP', 'SI', 'NI', + /// 'CP', 'NP', 'SP' + /// + /// + /// Government storm Id + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> GetTropicalStormSearchWithHttpMessagesAsync(int year, string basinId = default(string), int? governmentStormId = default(int?), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// **Get Tropical Storm Forecasts** + /// + /// **Applies to**: see pricing + /// [tiers](https://aka.ms/AzureMapsPricingTier). + /// + /// Get individual government-issued tropical storm forecasts. + /// Information about the forecasted tropical storms includes, + /// location, status, date the forecast was created, window, wind speed + /// and wind radii. + /// + /// + /// Year of the cyclone(s) + /// + /// + /// Basin identifier. Possible values include: 'AL', 'EP', 'SI', 'NI', + /// 'CP', 'NP', 'SP' + /// + /// + /// Government storm Id + /// + /// + /// Specifies to return the data in either metric units or imperial + /// units. Default value is metric. Possible values include: 'metric', + /// 'imperial' + /// + /// + /// When true, wind radii summary data is included in the response + /// + /// + /// When true, wind radii summary data and geoJSON details are included + /// in the response + /// + /// + /// When true, window geometry data (geoJSON) is included in the + /// response + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> GetTropicalStormForecastWithHttpMessagesAsync(int year, string basinId, int governmentStormId, string unit = default(string), bool? includeDetails = false, bool? includeGeometricDetails = false, bool? includeWindowGeometry = false, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// **Get Tropical Storm Locations** + /// + /// **Applies to**: see pricing + /// [tiers](https://aka.ms/AzureMapsPricingTier). + /// + /// Get location of individual government-issued tropical storms. + /// Information about the tropical storms includes, location + /// coordinates, geometry, basin ID, date, wind details and wind radii. + /// + /// + /// Year of the cyclone(s) + /// + /// + /// Basin identifier. Possible values include: 'AL', 'EP', 'SI', 'NI', + /// 'CP', 'NP', 'SP' + /// + /// + /// Government storm Id + /// + /// + /// When true, wind radii summary data is included in the response + /// + /// + /// When true, wind radii summary data and geoJSON details are included + /// in the response + /// + /// + /// Specifies to return the data in either metric units or imperial + /// units. Default value is metric. Possible values include: 'metric', + /// 'imperial' + /// + /// + /// When true, return the current storm location + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> GetTropicalStormLocationsWithHttpMessagesAsync(int year, string basinId, int governmentStormId, bool? includeDetails = false, bool? includeGeometricDetails = false, string unit = default(string), bool? includeCurrentStorm = false, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// **Get Current Air Quality** + /// + /// **Applies to**: see pricing + /// [tiers](https://aka.ms/AzureMapsPricingTier). + /// + /// Get detailed information about the concentration of pollutants and + /// overall status for current air quality. Information includes, + /// pollution levels, air quality index values, the dominant pollutant, + /// and a brief statement summarizing risk level and suggested + /// precautions. + /// + /// + /// The applicable query specified as a comma separated string composed + /// by latitude followed by longitude e.g. "47.641268,-122.125679". + /// + /// + /// Language in which search results should be returned. Should be one + /// of supported IETF language tags, case insensitive. When data in + /// specified language is not available for a specific field, default + /// language is used. + /// + /// Please refer to [Supported + /// Languages](https://docs.microsoft.com/azure/azure-maps/supported-languages) + /// for details. + /// + /// + /// Boolean value that returns detailed information about each + /// pollutant. By default is True. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> GetCurrentAirQualityWithHttpMessagesAsync(IList coordinates, string language = default(string), bool? includePollutantDetails = default(bool?), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// **Get Air Quality Daily Forecasts** + /// + /// **Applies to**: see pricing + /// [tiers](https://aka.ms/AzureMapsPricingTier). + /// + /// Get detailed information about the concentration of pollutants and + /// overall status of forecasted daily air quality. The service can + /// provide forecasted daily air quality information for the upcoming 1 + /// to 7 days. Information includes, pollution levels, air quality + /// index values, the dominant pollutant, and a brief statement + /// summarizing risk level and suggested precautions. + /// + /// + /// The applicable query specified as a comma separated string composed + /// by latitude followed by longitude e.g. "47.641268,-122.125679". + /// + /// + /// Language in which search results should be returned. Should be one + /// of supported IETF language tags, case insensitive. When data in + /// specified language is not available for a specific field, default + /// language is used. + /// + /// Please refer to [Supported + /// Languages](https://docs.microsoft.com/azure/azure-maps/supported-languages) + /// for details. + /// + /// + /// Specifies for how many days from now we would like to know about + /// the air quality. Available values are 1, 2, 3, 4, 5, 6, and 7. + /// Default value is 1. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> GetAirQualityDailyForecastsWithHttpMessagesAsync(IList coordinates, string language = default(string), int? duration = 1, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// **Get Air Quality Hourly Forecasts** + /// + /// **Applies to**: see pricing + /// [tiers](https://aka.ms/AzureMapsPricingTier). + /// + /// Get detailed information about the concentration of pollutants and + /// overall status for forecasted upcoming hourly air quality. The + /// service can provide forecasted hourly air quality information for + /// the upcoming time spans of 1, 12, 24, 48, 72, and 96 hours. + /// Information includes, pollution levels, air quality index values, + /// the dominant pollutant, and a brief statement summarizing risk + /// level and suggested precautions. + /// + /// + /// The applicable query specified as a comma separated string composed + /// by latitude followed by longitude e.g. "47.641268,-122.125679". + /// + /// + /// Language in which search results should be returned. Should be one + /// of supported IETF language tags, case insensitive. When data in + /// specified language is not available for a specific field, default + /// language is used. + /// + /// Please refer to [Supported + /// Languages](https://docs.microsoft.com/azure/azure-maps/supported-languages) + /// for details. + /// + /// + /// Specifies for how many hours from now we would like to know about + /// the air quality. Available values are 1, 12, 24, 48, 72, 96. + /// Default value is 1 hour. + /// + /// + /// Boolean value that returns detailed information about each + /// pollutant. By default is True. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> GetAirQualityHourlyForecastsWithHttpMessagesAsync(IList coordinates, string language = default(string), int? duration = 1, bool? includePollutantDetails = default(bool?), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// **Get Daily Historical Actuals** + /// + /// + /// **Applies to**: see pricing + /// [tiers](https://aka.ms/AzureMapsPricingTier). + /// + /// + /// Get Daily Historical Actuals service returns climatology data such + /// as past daily actual observed temperatures, precipitation, + /// snowfall, snow depth and cooling/heating degree day information, + /// for the day at a given coordinate location. The data is requested + /// for a specified date range, up to 31 days in a single API request. + /// Generally, historical data may be available as far back as the last + /// 5 to 40+ years, depending on the location. + /// + /// + /// The applicable query specified as a comma separated string composed + /// by latitude followed by longitude e.g. "47.641268,-122.125679". + /// + /// + /// Start date in ISO 8601 format, for example, 2019-10-27. The date + /// range supported is 1 to 31 calendar days, so be sure to specify a + /// startDate and endDate that does not exceed a maximum of 31 days + /// (i.e.: startDate=2012-01-01&endDate=2012-01-31). + /// + /// + /// End date in ISO 8601 format, for example, 2019-10-28. The date + /// range supported is 1 to 31 calendar days, so be sure to specify a + /// startDate and endDate that does not exceed a maximum of 31 days + /// (i.e.: startDate=2012-01-01&endDate=2012-01-31). + /// + /// + /// Specifies to return the data in either metric units or imperial + /// units. Default value is metric. Possible values include: 'metric', + /// 'imperial' + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> GetDailyHistoricalActualsWithHttpMessagesAsync(IList coordinates, System.DateTime startDate, System.DateTime endDate, string unit = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// **Get Daily Historical Records** + /// + /// + /// **Applies to**: see pricing + /// [tiers](https://aka.ms/AzureMapsPricingTier). + /// + /// + /// Get Daily Historical Records service returns climatology data such + /// as past daily record temperatures, precipitation and snowfall at a + /// given coordinate location. Availability of records data will vary + /// by location. Generally, historical data may be available as far + /// back as the last 5 to 40+ years, depending on the location. + /// + /// + /// The applicable query specified as a comma separated string composed + /// by latitude followed by longitude e.g. "47.641268,-122.125679". + /// + /// + /// Start date in ISO 8601 format, for example, 2019-10-27. The date + /// range supported is 1 to 31 calendar days, so be sure to specify a + /// startDate and endDate that does not exceed a maximum of 31 days + /// (i.e.: startDate=2012-01-01&endDate=2012-01-31). + /// + /// + /// End date in ISO 8601 format, for example, 2019-10-28. The date + /// range supported is 1 to 31 calendar days, so be sure to specify a + /// startDate and endDate that does not exceed a maximum of 31 days + /// (i.e.: startDate=2012-01-01&endDate=2012-01-31). + /// + /// + /// Specifies to return the data in either metric units or imperial + /// units. Default value is metric. Possible values include: 'metric', + /// 'imperial' + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> GetDailyHistoricalRecordsWithHttpMessagesAsync(IList coordinates, System.DateTime startDate, System.DateTime endDate, string unit = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// **Get Daily Historical Normals** + /// + /// + /// **Applies to**: see pricing + /// [tiers](https://aka.ms/AzureMapsPricingTier). + /// + /// + /// Get Daily Historical Normals service returns climatology data such + /// as past daily normal temperatures, precipitation and + /// cooling/heating degree day information for the day at a given + /// coordinate location. Normals are a 30-year average for temperatures + /// and precipitation for a specific location. As is standard practice + /// in climatology, the 30-year average covers years 1991-2020, this + /// data will be used for one decade and then will reset in the year + /// 2030. Generally, historical data may be available as far back as + /// the last 5 to 40+ years, depending on the location. + /// + /// + /// The applicable query specified as a comma separated string composed + /// by latitude followed by longitude e.g. "47.641268,-122.125679". + /// + /// + /// Start date in ISO 8601 format, for example, 2019-10-27. The date + /// range supported is 1 to 31 calendar days, so be sure to specify a + /// startDate and endDate that does not exceed a maximum of 31 days + /// (i.e.: startDate=2012-01-01&endDate=2012-01-31). + /// + /// + /// End date in ISO 8601 format, for example, 2019-10-28. The date + /// range supported is 1 to 31 calendar days, so be sure to specify a + /// startDate and endDate that does not exceed a maximum of 31 days + /// (i.e.: startDate=2012-01-01&endDate=2012-01-31). + /// + /// + /// Specifies to return the data in either metric units or imperial + /// units. Default value is metric. Possible values include: 'metric', + /// 'imperial' + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> GetDailyHistoricalNormalsWithHttpMessagesAsync(IList coordinates, System.DateTime startDate, System.DateTime endDate, string unit = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + } +} diff --git a/sdk/maps/Azure.Maps.Weather/src/Generated/Models/ActiveStorm.cs b/sdk/maps/Azure.Maps.Weather/src/Generated/Models/ActiveStorm.cs new file mode 100644 index 000000000000..16b8bef91f65 --- /dev/null +++ b/sdk/maps/Azure.Maps.Weather/src/Generated/Models/ActiveStorm.cs @@ -0,0 +1,99 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Azure.Maps.Weather.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Government-issued active storm + /// + public partial class ActiveStorm + { + /// + /// Initializes a new instance of the ActiveStorm class. + /// + public ActiveStorm() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the ActiveStorm class. + /// + /// Year of origination + /// Basin identifier (AL, EP, SI, NI, CP, NP, + /// SP). Possible values include: 'AL', 'EP', 'SI', 'NI', 'CP', 'NP', + /// 'SP' + /// The name of the depression. + /// True if the depression has been updated + /// recently. + /// True when the depression is classified + /// as a subtropical cyclone. + /// Government storm ID. This will match the + /// depression number. + public ActiveStorm(string year = default(string), string basinId = default(string), string name = default(string), bool? isActive = default(bool?), bool? isSubtropical = default(bool?), int? govId = default(int?)) + { + Year = year; + BasinId = basinId; + Name = name; + IsActive = isActive; + IsSubtropical = isSubtropical; + GovId = govId; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets year of origination + /// + [JsonProperty(PropertyName = "year")] + public string Year { get; set; } + + /// + /// Gets or sets basin identifier (AL, EP, SI, NI, CP, NP, SP). + /// Possible values include: 'AL', 'EP', 'SI', 'NI', 'CP', 'NP', 'SP' + /// + [JsonProperty(PropertyName = "basinId")] + public string BasinId { get; set; } + + /// + /// Gets or sets the name of the depression. + /// + [JsonProperty(PropertyName = "name")] + public string Name { get; set; } + + /// + /// Gets or sets true if the depression has been updated recently. + /// + [JsonProperty(PropertyName = "isActive")] + public bool? IsActive { get; set; } + + /// + /// Gets or sets true when the depression is classified as a + /// subtropical cyclone. + /// + [JsonProperty(PropertyName = "isSubtropical")] + public bool? IsSubtropical { get; set; } + + /// + /// Gets or sets government storm ID. This will match the depression + /// number. + /// + [JsonProperty(PropertyName = "govId")] + public int? GovId { get; set; } + + } +} diff --git a/sdk/maps/Azure.Maps.Weather/src/Generated/Models/ActiveStormResult.cs b/sdk/maps/Azure.Maps.Weather/src/Generated/Models/ActiveStormResult.cs new file mode 100644 index 000000000000..a7881322a247 --- /dev/null +++ b/sdk/maps/Azure.Maps.Weather/src/Generated/Models/ActiveStormResult.cs @@ -0,0 +1,60 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Azure.Maps.Weather.Models +{ + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// All government-issued active storms + /// + public partial class ActiveStormResult + { + /// + /// Initializes a new instance of the ActiveStormResult class. + /// + public ActiveStormResult() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the ActiveStormResult class. + /// + /// All government-issued active + /// storms + public ActiveStormResult(IList activeStorms = default(IList), string nextLink = default(string)) + { + ActiveStorms = activeStorms; + NextLink = nextLink; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets all government-issued active storms + /// + [JsonProperty(PropertyName = "results")] + public IList ActiveStorms { get; set; } + + /// + /// + [JsonProperty(PropertyName = "nextLink")] + public string NextLink { get; set; } + + } +} diff --git a/sdk/maps/Azure.Maps.Weather/src/Generated/Models/AirAndPollen.cs b/sdk/maps/Azure.Maps.Weather/src/Generated/Models/AirAndPollen.cs new file mode 100644 index 000000000000..c94911c4bbe1 --- /dev/null +++ b/sdk/maps/Azure.Maps.Weather/src/Generated/Models/AirAndPollen.cs @@ -0,0 +1,96 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Azure.Maps.Weather.Models +{ + using Newtonsoft.Json; + using System.Linq; + + public partial class AirAndPollen + { + /// + /// Initializes a new instance of the AirAndPollen class. + /// + public AirAndPollen() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the AirAndPollen class. + /// + /// Name of the pollen or pollutant. For + /// example, grass, mold, weed, air quality, tree and UV index. + /// Value of the given type above. Values + /// associated with mold, grass, weed and tree are in units of parts + /// per cubic meter. Both air quality and UV are indices, so they are + /// unitless. + /// Category of the air quality or pollution + /// type. For example, low, high, good, moderate, unhealthy, + /// hazardous. + /// Value associated with the air quality + /// or pollution category. These values range from 1 to 6. 1 implying + /// good conditions, 6 implying hazardous conditions. + /// Only exists for air quality. Examples + /// include ozone and particle pollution. + public AirAndPollen(string description = default(string), int? value = default(int?), string category = default(string), int? categoryValue = default(int?), string airQualityType = default(string)) + { + Description = description; + Value = value; + Category = category; + CategoryValue = categoryValue; + AirQualityType = airQualityType; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets name of the pollen or pollutant. For example, grass, + /// mold, weed, air quality, tree and UV index. + /// + [JsonProperty(PropertyName = "name")] + public string Description { get; set; } + + /// + /// Gets or sets value of the given type above. Values associated with + /// mold, grass, weed and tree are in units of parts per cubic meter. + /// Both air quality and UV are indices, so they are unitless. + /// + [JsonProperty(PropertyName = "value")] + public int? Value { get; set; } + + /// + /// Gets or sets category of the air quality or pollution type. For + /// example, low, high, good, moderate, unhealthy, hazardous. + /// + [JsonProperty(PropertyName = "category")] + public string Category { get; set; } + + /// + /// Gets or sets value associated with the air quality or pollution + /// category. These values range from 1 to 6. 1 implying good + /// conditions, 6 implying hazardous conditions. + /// + [JsonProperty(PropertyName = "categoryValue")] + public int? CategoryValue { get; set; } + + /// + /// Gets or sets only exists for air quality. Examples include ozone + /// and particle pollution. + /// + [JsonProperty(PropertyName = "type")] + public string AirQualityType { get; set; } + + } +} diff --git a/sdk/maps/Azure.Maps.Weather/src/Generated/Models/AirQuality.cs b/sdk/maps/Azure.Maps.Weather/src/Generated/Models/AirQuality.cs new file mode 100644 index 000000000000..f7b2bfccf9c4 --- /dev/null +++ b/sdk/maps/Azure.Maps.Weather/src/Generated/Models/AirQuality.cs @@ -0,0 +1,135 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Azure.Maps.Weather.Models +{ + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// Information about the air quality in a specific location at a specific + /// time. + /// + public partial class AirQuality + { + /// + /// Initializes a new instance of the AirQuality class. + /// + public AirQuality() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the AirQuality class. + /// + /// Date and time of the current observation + /// displayed in ISO 8601 format, for example, + /// 2019-10-27T19:39:57-08:00. + /// Air quality rating on a scale set by local + /// regulating bodies. Scales can vary widely based on location. See + /// [Wikipedia](https://en.wikipedia.org/wiki/Air_quality_index) for + /// more information. + /// Internationally normalized air quality + /// rating on a scale from 0 to 300 and up, with higher numbers + /// representing worse air quality. + /// The pollutant with the highest + /// concentration. Possible values include: 'Carbon Monoxide', + /// 'Nitrogen Dioxide', 'Ozone', 'Particulate Matter 2.5', 'Particulate + /// Matter 10', 'Sulfur Dioxide' + /// One-word description of the air quality in + /// the requested language. For example, "Excellent". + /// A unique color corresponding to the + /// category of this air quality result. + /// A textual explanation of this air quality + /// result in the requested language. + /// Information about individual + /// pollutants. + public AirQuality(System.DateTime? timestamp = default(System.DateTime?), double? index = default(double?), double? globalIndex = default(double?), string dominantPollutant = default(string), string category = default(string), string categoryColor = default(string), string description = default(string), IList pollutants = default(IList)) + { + Timestamp = timestamp; + Index = index; + GlobalIndex = globalIndex; + DominantPollutant = dominantPollutant; + Category = category; + CategoryColor = categoryColor; + Description = description; + Pollutants = pollutants; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets date and time of the current observation displayed in + /// ISO 8601 format, for example, 2019-10-27T19:39:57-08:00. + /// + [JsonProperty(PropertyName = "dateTime")] + public System.DateTime? Timestamp { get; set; } + + /// + /// Gets or sets air quality rating on a scale set by local regulating + /// bodies. Scales can vary widely based on location. See + /// [Wikipedia](https://en.wikipedia.org/wiki/Air_quality_index) for + /// more information. + /// + [JsonProperty(PropertyName = "index")] + public double? Index { get; set; } + + /// + /// Gets or sets internationally normalized air quality rating on a + /// scale from 0 to 300 and up, with higher numbers representing worse + /// air quality. + /// + [JsonProperty(PropertyName = "globalIndex")] + public double? GlobalIndex { get; set; } + + /// + /// Gets or sets the pollutant with the highest concentration. Possible + /// values include: 'Carbon Monoxide', 'Nitrogen Dioxide', 'Ozone', + /// 'Particulate Matter 2.5', 'Particulate Matter 10', 'Sulfur Dioxide' + /// + [JsonProperty(PropertyName = "dominantPollutant")] + public string DominantPollutant { get; set; } + + /// + /// Gets or sets one-word description of the air quality in the + /// requested language. For example, "Excellent". + /// + [JsonProperty(PropertyName = "category")] + public string Category { get; set; } + + /// + /// Gets or sets a unique color corresponding to the category of this + /// air quality result. + /// + [JsonProperty(PropertyName = "categoryColor")] + public string CategoryColor { get; set; } + + /// + /// Gets or sets a textual explanation of this air quality result in + /// the requested language. + /// + [JsonProperty(PropertyName = "description")] + public string Description { get; set; } + + /// + /// Gets or sets information about individual pollutants. + /// + [JsonProperty(PropertyName = "pollutants")] + public IList Pollutants { get; set; } + + } +} diff --git a/sdk/maps/Azure.Maps.Weather/src/Generated/Models/AirQualityResult.cs b/sdk/maps/Azure.Maps.Weather/src/Generated/Models/AirQualityResult.cs new file mode 100644 index 000000000000..5ee07fc954f8 --- /dev/null +++ b/sdk/maps/Azure.Maps.Weather/src/Generated/Models/AirQualityResult.cs @@ -0,0 +1,61 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Azure.Maps.Weather.Models +{ + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// This object is returned from a successful Get Air Quality call. + /// + public partial class AirQualityResult + { + /// + /// Initializes a new instance of the AirQualityResult class. + /// + public AirQualityResult() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the AirQualityResult class. + /// + /// A list of all air quality results + /// for the queried location. + public AirQualityResult(IList airQualityResults = default(IList), string nextLink = default(string)) + { + AirQualityResults = airQualityResults; + NextLink = nextLink; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets a list of all air quality results for the queried + /// location. + /// + [JsonProperty(PropertyName = "results")] + public IList AirQualityResults { get; set; } + + /// + /// + [JsonProperty(PropertyName = "nextLink")] + public string NextLink { get; set; } + + } +} diff --git a/sdk/maps/Azure.Maps.Weather/src/Generated/Models/AlertArea.cs b/sdk/maps/Azure.Maps.Weather/src/Generated/Models/AlertArea.cs new file mode 100644 index 000000000000..544c36c9cf1e --- /dev/null +++ b/sdk/maps/Azure.Maps.Weather/src/Generated/Models/AlertArea.cs @@ -0,0 +1,137 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Azure.Maps.Weather.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Information about a severe weather alert issued within an affected + /// area(s). If multiple alerts are active for the same location, the + /// alerts will be returned in order of `priority` within the API response, + /// with the highest priority alert being returned at the top of the + /// response. + /// + public partial class AlertArea + { + /// + /// Initializes a new instance of the AlertArea class. + /// + public AlertArea() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the AlertArea class. + /// + /// The name of an area which is affected by the + /// alert. The location that was requested falls under the alert + /// area. + /// Text summarizing the alert in the + /// returned area. + /// The start date and time of the alert in ISO + /// 8601 format, for example, 2019-10-27T19:39:57-08:00. If the alert + /// crosses multiple time zones the returned time in the response is + /// the local time to the requested coordinate location. + /// The end date and time of the alert in ISO + /// 8601 format, for example, 2019-10-27T19:39:57-08:00. If the alert + /// crosses multiple time zones the returned time in the response is + /// the local time to the requested coordinate location. + /// The latest status of the alert in the + /// current area. + /// Full details associated with the alert. + /// Returned if `details`=True. This field is always returned in the + /// language(s) of choice by the issuing provider and Azure Maps only + /// returns what is created by the provider. Please note, some + /// countries/regions may offer their native language and English. + /// Language parameter won’t apply to this field. + /// Language of the `alertDetails`. This field + /// helps to point out that the language of the `alertDetails` may + /// differ from the requested language parameter. Returned if + /// `details`=True. Language code has been derived from the ISO 639-1 + /// Alpha-2 codes. + public AlertArea(string name = default(string), string description = default(string), System.DateTime? startTime = default(System.DateTime?), System.DateTime? endTime = default(System.DateTime?), LatestStatus latestStatus = default(LatestStatus), string details = default(string), string language = default(string)) + { + Name = name; + Description = description; + StartTime = startTime; + EndTime = endTime; + LatestStatus = latestStatus; + Details = details; + Language = language; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the name of an area which is affected by the alert. + /// The location that was requested falls under the alert area. + /// + [JsonProperty(PropertyName = "name")] + public string Name { get; set; } + + /// + /// Gets or sets text summarizing the alert in the returned area. + /// + [JsonProperty(PropertyName = "summary")] + public string Description { get; set; } + + /// + /// Gets or sets the start date and time of the alert in ISO 8601 + /// format, for example, 2019-10-27T19:39:57-08:00. If the alert + /// crosses multiple time zones the returned time in the response is + /// the local time to the requested coordinate location. + /// + [JsonProperty(PropertyName = "startTime")] + public System.DateTime? StartTime { get; set; } + + /// + /// Gets or sets the end date and time of the alert in ISO 8601 format, + /// for example, 2019-10-27T19:39:57-08:00. If the alert crosses + /// multiple time zones the returned time in the response is the local + /// time to the requested coordinate location. + /// + [JsonProperty(PropertyName = "endTime")] + public System.DateTime? EndTime { get; set; } + + /// + /// Gets or sets the latest status of the alert in the current area. + /// + [JsonProperty(PropertyName = "latestStatus")] + public LatestStatus LatestStatus { get; set; } + + /// + /// Gets or sets full details associated with the alert. Returned if + /// `details`=True. This field is always returned in the language(s) of + /// choice by the issuing provider and Azure Maps only returns what is + /// created by the provider. Please note, some countries/regions may + /// offer their native language and English. Language parameter won’t + /// apply to this field. + /// + [JsonProperty(PropertyName = "alertDetails")] + public string Details { get; set; } + + /// + /// Gets or sets language of the `alertDetails`. This field helps to + /// point out that the language of the `alertDetails` may differ from + /// the requested language parameter. Returned if `details`=True. + /// Language code has been derived from the ISO 639-1 Alpha-2 codes. + /// + [JsonProperty(PropertyName = "alertDetailsLanguageCode")] + public string Language { get; set; } + + } +} diff --git a/sdk/maps/Azure.Maps.Weather/src/Generated/Models/BasinId.cs b/sdk/maps/Azure.Maps.Weather/src/Generated/Models/BasinId.cs new file mode 100644 index 000000000000..1b1d978467f3 --- /dev/null +++ b/sdk/maps/Azure.Maps.Weather/src/Generated/Models/BasinId.cs @@ -0,0 +1,48 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Azure.Maps.Weather.Models +{ + + /// + /// Defines values for BasinId. + /// + public static class BasinId + { + /// + /// Atlantic + /// + public const string AL = "AL"; + /// + /// Eastern Pacific + /// + public const string EP = "EP"; + /// + /// Southwest Indian Ocean + /// + public const string SI = "SI"; + /// + /// North Indian Ocean + /// + public const string NI = "NI"; + /// + /// Central Pacific + /// + public const string CP = "CP"; + /// + /// Northwest Pacific + /// + public const string NP = "NP"; + /// + /// South Pacific + /// + public const string SP = "SP"; + } +} diff --git a/sdk/maps/Azure.Maps.Weather/src/Generated/Models/ColorValue.cs b/sdk/maps/Azure.Maps.Weather/src/Generated/Models/ColorValue.cs new file mode 100644 index 000000000000..f535fc412111 --- /dev/null +++ b/sdk/maps/Azure.Maps.Weather/src/Generated/Models/ColorValue.cs @@ -0,0 +1,72 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Azure.Maps.Weather.Models +{ + using Newtonsoft.Json; + using System.Linq; + + public partial class ColorValue + { + /// + /// Initializes a new instance of the ColorValue class. + /// + public ColorValue() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the ColorValue class. + /// + /// Red component of the RGB value. + /// Green component of the RGB value. + /// Blue component of the RGB value + /// Hexadecimal color value. + public ColorValue(int? red = default(int?), int? green = default(int?), int? blue = default(int?), string hex = default(string)) + { + Red = red; + Green = green; + Blue = blue; + Hex = hex; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets red component of the RGB value. + /// + [JsonProperty(PropertyName = "red")] + public int? Red { get; set; } + + /// + /// Gets or sets green component of the RGB value. + /// + [JsonProperty(PropertyName = "green")] + public int? Green { get; set; } + + /// + /// Gets or sets blue component of the RGB value + /// + [JsonProperty(PropertyName = "blue")] + public int? Blue { get; set; } + + /// + /// Gets or sets hexadecimal color value. + /// + [JsonProperty(PropertyName = "hex")] + public string Hex { get; set; } + + } +} diff --git a/sdk/maps/Azure.Maps.Weather/src/Generated/Models/CurrentConditions.cs b/sdk/maps/Azure.Maps.Weather/src/Generated/Models/CurrentConditions.cs new file mode 100644 index 000000000000..11d77de3b13e --- /dev/null +++ b/sdk/maps/Azure.Maps.Weather/src/Generated/Models/CurrentConditions.cs @@ -0,0 +1,295 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Azure.Maps.Weather.Models +{ + using Newtonsoft.Json; + using System.Linq; + + public partial class CurrentConditions + { + /// + /// Initializes a new instance of the CurrentConditions class. + /// + public CurrentConditions() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the CurrentConditions class. + /// + /// Date and time of the current observation + /// displayed in ISO 8601 format, for example, + /// 2019-10-27T19:39:57-08:00. + /// Phrase description of the current weather + /// condition. Displayed in specified language. + /// Indicates the presence or absence of + /// precipitation. True indicates the presence of precipitation, false + /// indicates the absence of precipitation. + /// Indicates the time of the day. True + /// indicates 'day',', false indicates 'night. + /// Temperature being returned. + /// RealFeel™ Temperature being + /// returned. + /// RealFeel™ Temperature being + /// returned. Describes what the temperature really feels like in the + /// shade. + /// Relative humidity is the amount of + /// water vapor present in air expressed as a percentage of the amount + /// needed for saturation at the same temperature. + /// The dewpoint temperature in specified unit. + /// The dewpoint temperature is the temperature that the air must be + /// cooled to in order to reach saturation. + /// Wind details being returned including speed and + /// direction. + /// Wind gust. Wind gust is a sudden, brief + /// increase in speed of the wind. + /// Phrase associated with the + /// `uvIndex`. + /// Visibility in specified unit. A measure of + /// the distance at which an object or light can be clearly + /// discerned. + /// Cause of limited + /// visibility. + /// Percent representing cloud cover. + /// Cloud ceiling in specified unit. The + /// ceiling is a measurement of the height of the base of the lowest + /// clouds. + /// Atmospheric pressure in specified + /// unit. + /// Atmospheric pressure change. + /// Departure from + /// the temperature observed 24 hours ago in specified unit. + /// Perceived outdoor temperature + /// caused by the combination of air temperature, relative humidity, + /// and wind speed in specified unit. + /// Perceived air temperature on + /// exposed skin due to wind. + /// The temperature to which air may + /// be cooled by evaporating water into it at constant pressure until + /// it reaches saturation. + /// Summary of precipitation amounts + /// over the past 24 hours. + /// Summary of temperature + /// fluctuations over the past 6, 12, and 24 hours. + public CurrentConditions(System.DateTime? dateTime = default(System.DateTime?), string description = default(string), int? iconCode = default(int?), bool? hasPrecipitation = default(bool?), bool? isDaytime = default(bool?), WeatherUnit temperature = default(WeatherUnit), WeatherUnit realFeelTemperature = default(WeatherUnit), WeatherUnit realFeelTemperatureShade = default(WeatherUnit), int? relativeHumidity = default(int?), WeatherUnit dewPoint = default(WeatherUnit), WindDetails wind = default(WindDetails), WindDetails windGust = default(WindDetails), int? uvIndex = default(int?), string uvIndexDescription = default(string), WeatherUnit visibility = default(WeatherUnit), string obstructionsToVisibility = default(string), int? cloudCover = default(int?), WeatherUnit cloudCeiling = default(WeatherUnit), WeatherUnit pressure = default(WeatherUnit), PressureTendency pressureTendency = default(PressureTendency), WeatherUnit pastTwentyFourHourTemperatureDeparture = default(WeatherUnit), WeatherUnit apparentTemperature = default(WeatherUnit), WeatherUnit windChillTemperature = default(WeatherUnit), WeatherUnit wetBulbTemperature = default(WeatherUnit), PrecipitationSummary precipitationSummary = default(PrecipitationSummary), TemperatureSummary temperatureSummary = default(TemperatureSummary)) + { + DateTime = dateTime; + Description = description; + IconCode = iconCode; + HasPrecipitation = hasPrecipitation; + IsDaytime = isDaytime; + Temperature = temperature; + RealFeelTemperature = realFeelTemperature; + RealFeelTemperatureShade = realFeelTemperatureShade; + RelativeHumidity = relativeHumidity; + DewPoint = dewPoint; + Wind = wind; + WindGust = windGust; + UvIndex = uvIndex; + UvIndexDescription = uvIndexDescription; + Visibility = visibility; + ObstructionsToVisibility = obstructionsToVisibility; + CloudCover = cloudCover; + CloudCeiling = cloudCeiling; + Pressure = pressure; + PressureTendency = pressureTendency; + PastTwentyFourHourTemperatureDeparture = pastTwentyFourHourTemperatureDeparture; + ApparentTemperature = apparentTemperature; + WindChillTemperature = windChillTemperature; + WetBulbTemperature = wetBulbTemperature; + PrecipitationSummary = precipitationSummary; + TemperatureSummary = temperatureSummary; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets date and time of the current observation displayed in + /// ISO 8601 format, for example, 2019-10-27T19:39:57-08:00. + /// + [JsonProperty(PropertyName = "dateTime")] + public System.DateTime? DateTime { get; set; } + + /// + /// Gets or sets phrase description of the current weather condition. + /// Displayed in specified language. + /// + [JsonProperty(PropertyName = "phrase")] + public string Description { get; set; } + + /// + /// + [JsonProperty(PropertyName = "iconCode")] + public int? IconCode { get; set; } + + /// + /// Gets or sets indicates the presence or absence of precipitation. + /// True indicates the presence of precipitation, false indicates the + /// absence of precipitation. + /// + [JsonProperty(PropertyName = "hasPrecipitation")] + public bool? HasPrecipitation { get; set; } + + /// + /// Gets or sets indicates the time of the day. True indicates 'day',', + /// false indicates 'night. + /// + [JsonProperty(PropertyName = "isDayTime")] + public bool? IsDaytime { get; set; } + + /// + /// Gets or sets temperature being returned. + /// + [JsonProperty(PropertyName = "temperature")] + public WeatherUnit Temperature { get; set; } + + /// + /// Gets or sets realFeel™ Temperature being returned. + /// + [JsonProperty(PropertyName = "realFeelTemperature")] + public WeatherUnit RealFeelTemperature { get; set; } + + /// + /// Gets or sets realFeel™ Temperature being returned. Describes what + /// the temperature really feels like in the shade. + /// + [JsonProperty(PropertyName = "realFeelTemperatureShade")] + public WeatherUnit RealFeelTemperatureShade { get; set; } + + /// + /// Gets or sets relative humidity is the amount of water vapor present + /// in air expressed as a percentage of the amount needed for + /// saturation at the same temperature. + /// + [JsonProperty(PropertyName = "relativeHumidity")] + public int? RelativeHumidity { get; set; } + + /// + /// Gets or sets the dewpoint temperature in specified unit. The + /// dewpoint temperature is the temperature that the air must be cooled + /// to in order to reach saturation. + /// + [JsonProperty(PropertyName = "dewPoint")] + public WeatherUnit DewPoint { get; set; } + + /// + /// Gets or sets wind details being returned including speed and + /// direction. + /// + [JsonProperty(PropertyName = "wind")] + public WindDetails Wind { get; set; } + + /// + /// Gets or sets wind gust. Wind gust is a sudden, brief increase in + /// speed of the wind. + /// + [JsonProperty(PropertyName = "windGust")] + public WindDetails WindGust { get; set; } + + /// + /// + [JsonProperty(PropertyName = "uvIndex")] + public int? UvIndex { get; set; } + + /// + /// Gets or sets phrase associated with the `uvIndex`. + /// + [JsonProperty(PropertyName = "uvIndexPhrase")] + public string UvIndexDescription { get; set; } + + /// + /// Gets or sets visibility in specified unit. A measure of the + /// distance at which an object or light can be clearly discerned. + /// + [JsonProperty(PropertyName = "visibility")] + public WeatherUnit Visibility { get; set; } + + /// + /// Gets or sets cause of limited visibility. + /// + [JsonProperty(PropertyName = "obstructionsToVisibility")] + public string ObstructionsToVisibility { get; set; } + + /// + /// Gets or sets percent representing cloud cover. + /// + [JsonProperty(PropertyName = "cloudCover")] + public int? CloudCover { get; set; } + + /// + /// Gets or sets cloud ceiling in specified unit. The ceiling is a + /// measurement of the height of the base of the lowest clouds. + /// + [JsonProperty(PropertyName = "ceiling")] + public WeatherUnit CloudCeiling { get; set; } + + /// + /// Gets or sets atmospheric pressure in specified unit. + /// + [JsonProperty(PropertyName = "pressure")] + public WeatherUnit Pressure { get; set; } + + /// + /// Gets or sets atmospheric pressure change. + /// + [JsonProperty(PropertyName = "pressureTendency")] + public PressureTendency PressureTendency { get; set; } + + /// + /// Gets or sets departure from the temperature observed 24 hours ago + /// in specified unit. + /// + [JsonProperty(PropertyName = "pastTwentyFourHourTemperatureDeparture")] + public WeatherUnit PastTwentyFourHourTemperatureDeparture { get; set; } + + /// + /// Gets or sets perceived outdoor temperature caused by the + /// combination of air temperature, relative humidity, and wind speed + /// in specified unit. + /// + [JsonProperty(PropertyName = "apparentTemperature")] + public WeatherUnit ApparentTemperature { get; set; } + + /// + /// Gets or sets perceived air temperature on exposed skin due to wind. + /// + [JsonProperty(PropertyName = "windChillTemperature")] + public WeatherUnit WindChillTemperature { get; set; } + + /// + /// Gets or sets the temperature to which air may be cooled by + /// evaporating water into it at constant pressure until it reaches + /// saturation. + /// + [JsonProperty(PropertyName = "wetBulbTemperature")] + public WeatherUnit WetBulbTemperature { get; set; } + + /// + /// Gets or sets summary of precipitation amounts over the past 24 + /// hours. + /// + [JsonProperty(PropertyName = "precipitationSummary")] + public PrecipitationSummary PrecipitationSummary { get; set; } + + /// + /// Gets or sets summary of temperature fluctuations over the past 6, + /// 12, and 24 hours. + /// + [JsonProperty(PropertyName = "temperatureSummary")] + public TemperatureSummary TemperatureSummary { get; set; } + + } +} diff --git a/sdk/maps/Azure.Maps.Weather/src/Generated/Models/CurrentConditionsResult.cs b/sdk/maps/Azure.Maps.Weather/src/Generated/Models/CurrentConditionsResult.cs new file mode 100644 index 000000000000..7a85af5c27b6 --- /dev/null +++ b/sdk/maps/Azure.Maps.Weather/src/Generated/Models/CurrentConditionsResult.cs @@ -0,0 +1,50 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Azure.Maps.Weather.Models +{ + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + public partial class CurrentConditionsResult + { + /// + /// Initializes a new instance of the CurrentConditionsResult class. + /// + public CurrentConditionsResult() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the CurrentConditionsResult class. + /// + /// Detailed current weather conditions. + public CurrentConditionsResult(IList results = default(IList)) + { + Results = results; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets detailed current weather conditions. + /// + [JsonProperty(PropertyName = "results")] + public IList Results { get; private set; } + + } +} diff --git a/sdk/maps/Azure.Maps.Weather/src/Generated/Models/DailyAirQuality.cs b/sdk/maps/Azure.Maps.Weather/src/Generated/Models/DailyAirQuality.cs new file mode 100644 index 000000000000..f8661d1d71ae --- /dev/null +++ b/sdk/maps/Azure.Maps.Weather/src/Generated/Models/DailyAirQuality.cs @@ -0,0 +1,124 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Azure.Maps.Weather.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Information about the air quality in a specific location at a specific + /// time. + /// + public partial class DailyAirQuality + { + /// + /// Initializes a new instance of the DailyAirQuality class. + /// + public DailyAirQuality() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the DailyAirQuality class. + /// + /// Date and time of the current observation + /// displayed in ISO 8601 format, for example, + /// 2019-10-27T19:39:57-08:00. + /// Air quality rating on a scale set by local + /// regulating bodies. Scales can vary widely based on location. See + /// [Wikipedia](https://en.wikipedia.org/wiki/Air_quality_index) for + /// more information. + /// Internationally normalized air quality + /// rating on a scale from 0 to 300 and up, with higher numbers + /// representing worse air quality. + /// The pollutant with the highest + /// concentration. Possible values include: 'Carbon Monoxide', + /// 'Nitrogen Dioxide', 'Ozone', 'Particulate Matter 2.5', 'Particulate + /// Matter 10', 'Sulfur Dioxide' + /// One-word description of the air quality in + /// the requested language. For example, "Excellent". + /// A unique color corresponding to the + /// category of this air quality result. + /// A textual explanation of this air quality + /// result in the requested language. + public DailyAirQuality(System.DateTime? timestamp = default(System.DateTime?), double? index = default(double?), double? globalIndex = default(double?), string dominantPollutant = default(string), string category = default(string), string categoryColor = default(string), string description = default(string)) + { + Timestamp = timestamp; + Index = index; + GlobalIndex = globalIndex; + DominantPollutant = dominantPollutant; + Category = category; + CategoryColor = categoryColor; + Description = description; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets date and time of the current observation displayed in + /// ISO 8601 format, for example, 2019-10-27T19:39:57-08:00. + /// + [JsonProperty(PropertyName = "dateTime")] + public System.DateTime? Timestamp { get; set; } + + /// + /// Gets or sets air quality rating on a scale set by local regulating + /// bodies. Scales can vary widely based on location. See + /// [Wikipedia](https://en.wikipedia.org/wiki/Air_quality_index) for + /// more information. + /// + [JsonProperty(PropertyName = "index")] + public double? Index { get; set; } + + /// + /// Gets or sets internationally normalized air quality rating on a + /// scale from 0 to 300 and up, with higher numbers representing worse + /// air quality. + /// + [JsonProperty(PropertyName = "globalIndex")] + public double? GlobalIndex { get; set; } + + /// + /// Gets or sets the pollutant with the highest concentration. Possible + /// values include: 'Carbon Monoxide', 'Nitrogen Dioxide', 'Ozone', + /// 'Particulate Matter 2.5', 'Particulate Matter 10', 'Sulfur Dioxide' + /// + [JsonProperty(PropertyName = "dominantPollutant")] + public string DominantPollutant { get; set; } + + /// + /// Gets or sets one-word description of the air quality in the + /// requested language. For example, "Excellent". + /// + [JsonProperty(PropertyName = "category")] + public string Category { get; set; } + + /// + /// Gets or sets a unique color corresponding to the category of this + /// air quality result. + /// + [JsonProperty(PropertyName = "categoryColor")] + public string CategoryColor { get; set; } + + /// + /// Gets or sets a textual explanation of this air quality result in + /// the requested language. + /// + [JsonProperty(PropertyName = "description")] + public string Description { get; set; } + + } +} diff --git a/sdk/maps/Azure.Maps.Weather/src/Generated/Models/DailyAirQualityForecastResult.cs b/sdk/maps/Azure.Maps.Weather/src/Generated/Models/DailyAirQualityForecastResult.cs new file mode 100644 index 000000000000..0256eba2013f --- /dev/null +++ b/sdk/maps/Azure.Maps.Weather/src/Generated/Models/DailyAirQualityForecastResult.cs @@ -0,0 +1,64 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Azure.Maps.Weather.Models +{ + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// This object is returned from a successful Get Daily Air Quality + /// Forecast call. + /// + public partial class DailyAirQualityForecastResult + { + /// + /// Initializes a new instance of the DailyAirQualityForecastResult + /// class. + /// + public DailyAirQualityForecastResult() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the DailyAirQualityForecastResult + /// class. + /// + /// A list of all daily air quality + /// forecasts for the queried location. + public DailyAirQualityForecastResult(IList airQualityResults = default(IList), string nextLink = default(string)) + { + AirQualityResults = airQualityResults; + NextLink = nextLink; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets a list of all daily air quality forecasts for the + /// queried location. + /// + [JsonProperty(PropertyName = "results")] + public IList AirQualityResults { get; set; } + + /// + /// + [JsonProperty(PropertyName = "nextLink")] + public string NextLink { get; set; } + + } +} diff --git a/sdk/maps/Azure.Maps.Weather/src/Generated/Models/DailyForecast.cs b/sdk/maps/Azure.Maps.Weather/src/Generated/Models/DailyForecast.cs new file mode 100644 index 000000000000..8af460bdb49f --- /dev/null +++ b/sdk/maps/Azure.Maps.Weather/src/Generated/Models/DailyForecast.cs @@ -0,0 +1,131 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Azure.Maps.Weather.Models +{ + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + public partial class DailyForecast + { + /// + /// Initializes a new instance of the DailyForecast class. + /// + public DailyForecast() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the DailyForecast class. + /// + /// Date and time of the current observation + /// displayed in ISO 8601 format, for example, + /// 2019-10-27T19:39:57-08:00. + /// Temperature values for the day. + /// RealFeel™ Temperature being + /// returned. + /// RealFeel™ Temperature being + /// returned. Describes what the temperature really feels like in the + /// shade. + /// Hours of sun. + /// Summary for mean temperature + /// of Heating Degree Day or Cooling Degree Day information + /// Air quality + /// Day forecast detail + /// Night forecast detail + /// Source(s) of the forecast data. + public DailyForecast(System.DateTime? dateTime = default(System.DateTime?), WeatherUnitRange temperature = default(WeatherUnitRange), WeatherUnitRange realFeelTemperature = default(WeatherUnitRange), WeatherUnitRange realFeelTemperatureShade = default(WeatherUnitRange), double? hoursOfSun = default(double?), DegreeDaySummary meanTemperatureDeviation = default(DegreeDaySummary), IList airQuality = default(IList), DayOrNight daytimeForecast = default(DayOrNight), DayOrNight nighttimeForecast = default(DayOrNight), IList sources = default(IList)) + { + DateTime = dateTime; + Temperature = temperature; + RealFeelTemperature = realFeelTemperature; + RealFeelTemperatureShade = realFeelTemperatureShade; + HoursOfSun = hoursOfSun; + MeanTemperatureDeviation = meanTemperatureDeviation; + AirQuality = airQuality; + DaytimeForecast = daytimeForecast; + NighttimeForecast = nighttimeForecast; + Sources = sources; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets date and time of the current observation displayed in + /// ISO 8601 format, for example, 2019-10-27T19:39:57-08:00. + /// + [JsonProperty(PropertyName = "date")] + public System.DateTime? DateTime { get; set; } + + /// + /// Gets or sets temperature values for the day. + /// + [JsonProperty(PropertyName = "temperature")] + public WeatherUnitRange Temperature { get; set; } + + /// + /// Gets or sets realFeel™ Temperature being returned. + /// + [JsonProperty(PropertyName = "realFeelTemperature")] + public WeatherUnitRange RealFeelTemperature { get; set; } + + /// + /// Gets or sets realFeel™ Temperature being returned. Describes what + /// the temperature really feels like in the shade. + /// + [JsonProperty(PropertyName = "realFeelTemperatureShade")] + public WeatherUnitRange RealFeelTemperatureShade { get; set; } + + /// + /// Gets or sets hours of sun. + /// + [JsonProperty(PropertyName = "hoursOfSun")] + public double? HoursOfSun { get; set; } + + /// + /// Gets or sets summary for mean temperature of Heating Degree Day or + /// Cooling Degree Day information + /// + [JsonProperty(PropertyName = "degreeDaySummary")] + public DegreeDaySummary MeanTemperatureDeviation { get; set; } + + /// + /// Gets or sets air quality + /// + [JsonProperty(PropertyName = "airAndPollen")] + public IList AirQuality { get; set; } + + /// + /// Gets or sets day forecast detail + /// + [JsonProperty(PropertyName = "day")] + public DayOrNight DaytimeForecast { get; set; } + + /// + /// Gets or sets night forecast detail + /// + [JsonProperty(PropertyName = "night")] + public DayOrNight NighttimeForecast { get; set; } + + /// + /// Gets or sets source(s) of the forecast data. + /// + [JsonProperty(PropertyName = "sources")] + public IList Sources { get; set; } + + } +} diff --git a/sdk/maps/Azure.Maps.Weather/src/Generated/Models/DailyForecastResult.cs b/sdk/maps/Azure.Maps.Weather/src/Generated/Models/DailyForecastResult.cs new file mode 100644 index 000000000000..3c856e533e73 --- /dev/null +++ b/sdk/maps/Azure.Maps.Weather/src/Generated/Models/DailyForecastResult.cs @@ -0,0 +1,57 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Azure.Maps.Weather.Models +{ + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + public partial class DailyForecastResult + { + /// + /// Initializes a new instance of the DailyForecastResult class. + /// + public DailyForecastResult() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the DailyForecastResult class. + /// + /// Forecast data for each requested + /// day. + public DailyForecastResult(DailyForecastSummary summary = default(DailyForecastSummary), IList forecasts = default(IList)) + { + Summary = summary; + Forecasts = forecasts; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// + [JsonProperty(PropertyName = "summary")] + public DailyForecastSummary Summary { get; private set; } + + /// + /// Gets forecast data for each requested day. + /// + [JsonProperty(PropertyName = "forecasts")] + public IList Forecasts { get; private set; } + + } +} diff --git a/sdk/maps/Azure.Maps.Weather/src/Generated/Models/DailyForecastSummary.cs b/sdk/maps/Azure.Maps.Weather/src/Generated/Models/DailyForecastSummary.cs new file mode 100644 index 000000000000..980aaef4e567 --- /dev/null +++ b/sdk/maps/Azure.Maps.Weather/src/Generated/Models/DailyForecastSummary.cs @@ -0,0 +1,93 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Azure.Maps.Weather.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Summary for the main conditions for the requested time period. Notice + /// that summary can cover only part of the time period. + /// + public partial class DailyForecastSummary + { + /// + /// Initializes a new instance of the DailyForecastSummary class. + /// + public DailyForecastSummary() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the DailyForecastSummary class. + /// + /// Date and time that the summary is in + /// effect, displayed in ISO 8601 format, for example, + /// 2019-10-27T19:39:57-08:00. + /// Date and time that the summary period ends, + /// displayed in ISO 8601 format, for example, + /// 2019-10-27T19:39:57-08:00. + /// severity + /// Summary phrase of the daily forecast. + /// Displayed in specified language. + /// one or 2 word(s) to summarize the + /// phrase. + public DailyForecastSummary(System.DateTime? startDate = default(System.DateTime?), System.DateTime? endDate = default(System.DateTime?), int? severity = default(int?), string phrase = default(string), string category = default(string)) + { + StartDate = startDate; + EndDate = endDate; + Severity = severity; + Phrase = phrase; + Category = category; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets date and time that the summary is in effect, displayed + /// in ISO 8601 format, for example, 2019-10-27T19:39:57-08:00. + /// + [JsonProperty(PropertyName = "startDate")] + public System.DateTime? StartDate { get; set; } + + /// + /// Gets or sets date and time that the summary period ends, displayed + /// in ISO 8601 format, for example, 2019-10-27T19:39:57-08:00. + /// + [JsonProperty(PropertyName = "endDate")] + public System.DateTime? EndDate { get; set; } + + /// + /// Gets or sets severity + /// + [JsonProperty(PropertyName = "severity")] + public int? Severity { get; set; } + + /// + /// Gets or sets summary phrase of the daily forecast. Displayed in + /// specified language. + /// + [JsonProperty(PropertyName = "phrase")] + public string Phrase { get; set; } + + /// + /// Gets or sets one or 2 word(s) to summarize the phrase. + /// + [JsonProperty(PropertyName = "category")] + public string Category { get; set; } + + } +} diff --git a/sdk/maps/Azure.Maps.Weather/src/Generated/Models/DailyHistoricalActuals.cs b/sdk/maps/Azure.Maps.Weather/src/Generated/Models/DailyHistoricalActuals.cs new file mode 100644 index 000000000000..c1f5b5fb219c --- /dev/null +++ b/sdk/maps/Azure.Maps.Weather/src/Generated/Models/DailyHistoricalActuals.cs @@ -0,0 +1,101 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Azure.Maps.Weather.Models +{ + using Newtonsoft.Json; + using System.Linq; + + public partial class DailyHistoricalActuals + { + /// + /// Initializes a new instance of the DailyHistoricalActuals class. + /// + public DailyHistoricalActuals() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the DailyHistoricalActuals class. + /// + /// Date and time of the current observation + /// displayed in ISO 8601 format, for example, + /// 2019-10-27T19:39:57-08:00. + /// Temperature values. + /// Summary of heating or cooling degree + /// day information. Degree days are measures of how cold or warm a + /// location is. A degree day compares the mean (the average of the + /// high and low) outdoor temperatures recorded for a location to a + /// standard temperature of 65 degrees F/ 18 degree C. + /// The amount of precipitation (liquid + /// equivalent) that has fallen. + /// The amount of snow that has fallen. + /// Snow depth. + public DailyHistoricalActuals(System.DateTime? timestamp = default(System.DateTime?), WeatherUnitMaxMinAvg temperature = default(WeatherUnitMaxMinAvg), DegreeDaySummary degreeDaySummary = default(DegreeDaySummary), WeatherUnit precipitation = default(WeatherUnit), WeatherUnit snowfall = default(WeatherUnit), WeatherUnit snowDepth = default(WeatherUnit)) + { + Timestamp = timestamp; + Temperature = temperature; + DegreeDaySummary = degreeDaySummary; + Precipitation = precipitation; + Snowfall = snowfall; + SnowDepth = snowDepth; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets date and time of the current observation displayed in + /// ISO 8601 format, for example, 2019-10-27T19:39:57-08:00. + /// + [JsonProperty(PropertyName = "date")] + public System.DateTime? Timestamp { get; set; } + + /// + /// Gets or sets temperature values. + /// + [JsonProperty(PropertyName = "temperature")] + public WeatherUnitMaxMinAvg Temperature { get; set; } + + /// + /// Gets or sets summary of heating or cooling degree day information. + /// Degree days are measures of how cold or warm a location is. A + /// degree day compares the mean (the average of the high and low) + /// outdoor temperatures recorded for a location to a standard + /// temperature of 65 degrees F/ 18 degree C. + /// + [JsonProperty(PropertyName = "degreeDaySummary")] + public DegreeDaySummary DegreeDaySummary { get; set; } + + /// + /// Gets or sets the amount of precipitation (liquid equivalent) that + /// has fallen. + /// + [JsonProperty(PropertyName = "precipitation")] + public WeatherUnit Precipitation { get; set; } + + /// + /// Gets or sets the amount of snow that has fallen. + /// + [JsonProperty(PropertyName = "snowfall")] + public WeatherUnit Snowfall { get; set; } + + /// + /// Gets or sets snow depth. + /// + [JsonProperty(PropertyName = "snowDepth")] + public WeatherUnit SnowDepth { get; set; } + + } +} diff --git a/sdk/maps/Azure.Maps.Weather/src/Generated/Models/DailyHistoricalActualsResult.cs b/sdk/maps/Azure.Maps.Weather/src/Generated/Models/DailyHistoricalActualsResult.cs new file mode 100644 index 000000000000..0dbeed4d4f3e --- /dev/null +++ b/sdk/maps/Azure.Maps.Weather/src/Generated/Models/DailyHistoricalActualsResult.cs @@ -0,0 +1,59 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Azure.Maps.Weather.Models +{ + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + public partial class DailyHistoricalActualsResult + { + /// + /// Initializes a new instance of the DailyHistoricalActualsResult + /// class. + /// + public DailyHistoricalActualsResult() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the DailyHistoricalActualsResult + /// class. + /// + /// Historical actuals for each + /// requested day. + public DailyHistoricalActualsResult(IList historicalActuals = default(IList), string nextLink = default(string)) + { + HistoricalActuals = historicalActuals; + NextLink = nextLink; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets historical actuals for each requested day. + /// + [JsonProperty(PropertyName = "results")] + public IList HistoricalActuals { get; set; } + + /// + /// + [JsonProperty(PropertyName = "nextLink")] + public string NextLink { get; set; } + + } +} diff --git a/sdk/maps/Azure.Maps.Weather/src/Generated/Models/DailyHistoricalNormals.cs b/sdk/maps/Azure.Maps.Weather/src/Generated/Models/DailyHistoricalNormals.cs new file mode 100644 index 000000000000..2a5a3b042e2a --- /dev/null +++ b/sdk/maps/Azure.Maps.Weather/src/Generated/Models/DailyHistoricalNormals.cs @@ -0,0 +1,78 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Azure.Maps.Weather.Models +{ + using Newtonsoft.Json; + using System.Linq; + + public partial class DailyHistoricalNormals + { + /// + /// Initializes a new instance of the DailyHistoricalNormals class. + /// + public DailyHistoricalNormals() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the DailyHistoricalNormals class. + /// + /// Date and time of the current observation + /// displayed in ISO 8601 format, for example, + /// 2019-10-27T19:39:57-08:00. + /// Temperature values. + /// Summary of heating or cooling degree + /// day information + /// The amount of precipitation (liquid + /// equivalent) that has fallen. + public DailyHistoricalNormals(System.DateTime? timestamp = default(System.DateTime?), WeatherUnitMaxMinAvg temperature = default(WeatherUnitMaxMinAvg), DegreeDaySummary degreeDaySummary = default(DegreeDaySummary), WeatherUnit precipitation = default(WeatherUnit)) + { + Timestamp = timestamp; + Temperature = temperature; + DegreeDaySummary = degreeDaySummary; + Precipitation = precipitation; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets date and time of the current observation displayed in + /// ISO 8601 format, for example, 2019-10-27T19:39:57-08:00. + /// + [JsonProperty(PropertyName = "date")] + public System.DateTime? Timestamp { get; set; } + + /// + /// Gets or sets temperature values. + /// + [JsonProperty(PropertyName = "temperature")] + public WeatherUnitMaxMinAvg Temperature { get; set; } + + /// + /// Gets or sets summary of heating or cooling degree day information + /// + [JsonProperty(PropertyName = "degreeDaySummary")] + public DegreeDaySummary DegreeDaySummary { get; set; } + + /// + /// Gets or sets the amount of precipitation (liquid equivalent) that + /// has fallen. + /// + [JsonProperty(PropertyName = "precipitation")] + public WeatherUnit Precipitation { get; set; } + + } +} diff --git a/sdk/maps/Azure.Maps.Weather/src/Generated/Models/DailyHistoricalNormalsResult.cs b/sdk/maps/Azure.Maps.Weather/src/Generated/Models/DailyHistoricalNormalsResult.cs new file mode 100644 index 000000000000..0f5750250afa --- /dev/null +++ b/sdk/maps/Azure.Maps.Weather/src/Generated/Models/DailyHistoricalNormalsResult.cs @@ -0,0 +1,59 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Azure.Maps.Weather.Models +{ + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + public partial class DailyHistoricalNormalsResult + { + /// + /// Initializes a new instance of the DailyHistoricalNormalsResult + /// class. + /// + public DailyHistoricalNormalsResult() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the DailyHistoricalNormalsResult + /// class. + /// + /// Historical normals for each + /// requested day. + public DailyHistoricalNormalsResult(IList historicalNormals = default(IList), string nextLink = default(string)) + { + HistoricalNormals = historicalNormals; + NextLink = nextLink; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets historical normals for each requested day. + /// + [JsonProperty(PropertyName = "results")] + public IList HistoricalNormals { get; set; } + + /// + /// + [JsonProperty(PropertyName = "nextLink")] + public string NextLink { get; set; } + + } +} diff --git a/sdk/maps/Azure.Maps.Weather/src/Generated/Models/DailyHistoricalRecords.cs b/sdk/maps/Azure.Maps.Weather/src/Generated/Models/DailyHistoricalRecords.cs new file mode 100644 index 000000000000..6d5f086ddf93 --- /dev/null +++ b/sdk/maps/Azure.Maps.Weather/src/Generated/Models/DailyHistoricalRecords.cs @@ -0,0 +1,77 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Azure.Maps.Weather.Models +{ + using Newtonsoft.Json; + using System.Linq; + + public partial class DailyHistoricalRecords + { + /// + /// Initializes a new instance of the DailyHistoricalRecords class. + /// + public DailyHistoricalRecords() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the DailyHistoricalRecords class. + /// + /// Date and time of the current observation + /// displayed in ISO 8601 format, for example, + /// 2019-10-27T19:39:57-08:00. + /// Temperature value. + /// Maximum amount of precipitation (liquid + /// equivalent) that has fallen. + /// Maximum snowfall. + public DailyHistoricalRecords(System.DateTime? timestamp = default(System.DateTime?), WeatherUnitYearMaxMinAvg temperature = default(WeatherUnitYearMaxMinAvg), WeatherUnitYearMax precipitation = default(WeatherUnitYearMax), WeatherUnitYearMax snowfall = default(WeatherUnitYearMax)) + { + Timestamp = timestamp; + Temperature = temperature; + Precipitation = precipitation; + Snowfall = snowfall; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets date and time of the current observation displayed in + /// ISO 8601 format, for example, 2019-10-27T19:39:57-08:00. + /// + [JsonProperty(PropertyName = "date")] + public System.DateTime? Timestamp { get; set; } + + /// + /// Gets or sets temperature value. + /// + [JsonProperty(PropertyName = "temperature")] + public WeatherUnitYearMaxMinAvg Temperature { get; set; } + + /// + /// Gets or sets maximum amount of precipitation (liquid equivalent) + /// that has fallen. + /// + [JsonProperty(PropertyName = "precipitation")] + public WeatherUnitYearMax Precipitation { get; set; } + + /// + /// Gets or sets maximum snowfall. + /// + [JsonProperty(PropertyName = "snowfall")] + public WeatherUnitYearMax Snowfall { get; set; } + + } +} diff --git a/sdk/maps/Azure.Maps.Weather/src/Generated/Models/DailyHistoricalRecordsResult.cs b/sdk/maps/Azure.Maps.Weather/src/Generated/Models/DailyHistoricalRecordsResult.cs new file mode 100644 index 000000000000..82abb03d3778 --- /dev/null +++ b/sdk/maps/Azure.Maps.Weather/src/Generated/Models/DailyHistoricalRecordsResult.cs @@ -0,0 +1,59 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Azure.Maps.Weather.Models +{ + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + public partial class DailyHistoricalRecordsResult + { + /// + /// Initializes a new instance of the DailyHistoricalRecordsResult + /// class. + /// + public DailyHistoricalRecordsResult() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the DailyHistoricalRecordsResult + /// class. + /// + /// Historical records for each + /// requested day. + public DailyHistoricalRecordsResult(IList historicalRecords = default(IList), string nextLink = default(string)) + { + HistoricalRecords = historicalRecords; + NextLink = nextLink; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets historical records for each requested day. + /// + [JsonProperty(PropertyName = "results")] + public IList HistoricalRecords { get; set; } + + /// + /// + [JsonProperty(PropertyName = "nextLink")] + public string NextLink { get; set; } + + } +} diff --git a/sdk/maps/Azure.Maps.Weather/src/Generated/Models/DailyIndex.cs b/sdk/maps/Azure.Maps.Weather/src/Generated/Models/DailyIndex.cs new file mode 100644 index 000000000000..bf8917a61fcd --- /dev/null +++ b/sdk/maps/Azure.Maps.Weather/src/Generated/Models/DailyIndex.cs @@ -0,0 +1,151 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Azure.Maps.Weather.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Information about a daily index. + /// + public partial class DailyIndex + { + /// + /// Initializes a new instance of the DailyIndex class. + /// + public DailyIndex() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the DailyIndex class. + /// + /// Name of the index, for example, + /// "Construction", "Outdoor Activity", "Flight Delays". + /// Numeric ID used to identify the specific + /// index. Please refer to [Weather Service + /// Concepts](https://aka.ms/AzureMapsWeatherConcepts) for details and + /// to see the supported index IDs. For example, the index ID can + /// support UI visualization scenarios. + /// Date and time of the current observation + /// displayed in ISO 8601 format, for example, + /// 2019-10-27T19:39:57-08:00. + /// Index value. Ranges from 0.0 to 10.0. Please + /// refer to [Weather Service + /// Concepts](https://aka.ms/AzureMapsWeatherConcepts) for details and + /// to see the supported ranges. + /// Textual description for + /// `categoryValue` corresponding to the level that the index value + /// falls under, for example "Very Good". + /// Level that the index value falls under, + /// represented by an integer. This value can be 1 through 5 and should + /// be used in combination with the `ascending` flag because it can + /// differ among indices. For example, the following values apply for + /// Mosquito Activity: Low=1, Moderate=2, High=3, Very High=4, and + /// Extreme=5. + /// Describes the direction of the `value` + /// and `categoryValue`. For example, when set to `true`, the poorest + /// index value is 0 and the best index value is 10. When set to + /// `true`, the poorest index value is 10 and the best index value is + /// 0. + /// A textual explanation that can be used + /// for display purposes to summarize the index value and category. For + /// example, when the index value for Flight Delays is very good, the + /// description will be "Conditions are excellent for flying!". + public DailyIndex(string indexName = default(string), int? indexId = default(int?), System.DateTime? dateTime = default(System.DateTime?), double? value = default(double?), string categoryDescription = default(string), int? categoryValue = default(int?), bool? isAscending = default(bool?), string description = default(string)) + { + IndexName = indexName; + IndexId = indexId; + DateTime = dateTime; + Value = value; + CategoryDescription = categoryDescription; + CategoryValue = categoryValue; + IsAscending = isAscending; + Description = description; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets name of the index, for example, "Construction", + /// "Outdoor Activity", "Flight Delays". + /// + [JsonProperty(PropertyName = "indexName")] + public string IndexName { get; set; } + + /// + /// Gets or sets numeric ID used to identify the specific index. Please + /// refer to [Weather Service + /// Concepts](https://aka.ms/AzureMapsWeatherConcepts) for details and + /// to see the supported index IDs. For example, the index ID can + /// support UI visualization scenarios. + /// + [JsonProperty(PropertyName = "indexId")] + public int? IndexId { get; set; } + + /// + /// Gets or sets date and time of the current observation displayed in + /// ISO 8601 format, for example, 2019-10-27T19:39:57-08:00. + /// + [JsonProperty(PropertyName = "dateTime")] + public System.DateTime? DateTime { get; set; } + + /// + /// Gets or sets index value. Ranges from 0.0 to 10.0. Please refer to + /// [Weather Service Concepts](https://aka.ms/AzureMapsWeatherConcepts) + /// for details and to see the supported ranges. + /// + [JsonProperty(PropertyName = "value")] + public double? Value { get; set; } + + /// + /// Gets or sets textual description for `categoryValue` corresponding + /// to the level that the index value falls under, for example "Very + /// Good". + /// + [JsonProperty(PropertyName = "category")] + public string CategoryDescription { get; set; } + + /// + /// Gets or sets level that the index value falls under, represented by + /// an integer. This value can be 1 through 5 and should be used in + /// combination with the `ascending` flag because it can differ among + /// indices. For example, the following values apply for Mosquito + /// Activity: Low=1, Moderate=2, High=3, Very High=4, and Extreme=5. + /// + [JsonProperty(PropertyName = "categoryValue")] + public int? CategoryValue { get; set; } + + /// + /// Gets or sets describes the direction of the `value` and + /// `categoryValue`. For example, when set to `true`, the poorest index + /// value is 0 and the best index value is 10. When set to `true`, the + /// poorest index value is 10 and the best index value is 0. + /// + [JsonProperty(PropertyName = "ascending")] + public bool? IsAscending { get; set; } + + /// + /// Gets or sets a textual explanation that can be used for display + /// purposes to summarize the index value and category. For example, + /// when the index value for Flight Delays is very good, the + /// description will be "Conditions are excellent for flying!". + /// + [JsonProperty(PropertyName = "description")] + public string Description { get; set; } + + } +} diff --git a/sdk/maps/Azure.Maps.Weather/src/Generated/Models/DailyIndicesResult.cs b/sdk/maps/Azure.Maps.Weather/src/Generated/Models/DailyIndicesResult.cs new file mode 100644 index 000000000000..6a0350938830 --- /dev/null +++ b/sdk/maps/Azure.Maps.Weather/src/Generated/Models/DailyIndicesResult.cs @@ -0,0 +1,54 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Azure.Maps.Weather.Models +{ + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// This object is returned from a successful Get Daily Indices call. + /// + public partial class DailyIndicesResult + { + /// + /// Initializes a new instance of the DailyIndicesResult class. + /// + public DailyIndicesResult() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the DailyIndicesResult class. + /// + /// A list of all daily indices for the queried + /// location. + public DailyIndicesResult(IList results = default(IList)) + { + Results = results; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets a list of all daily indices for the queried location. + /// + [JsonProperty(PropertyName = "results")] + public IList Results { get; private set; } + + } +} diff --git a/sdk/maps/Azure.Maps.Weather/src/Generated/Models/DayOrNight.cs b/sdk/maps/Azure.Maps.Weather/src/Generated/Models/DayOrNight.cs new file mode 100644 index 000000000000..b4e4af8ae7fd --- /dev/null +++ b/sdk/maps/Azure.Maps.Weather/src/Generated/Models/DayOrNight.cs @@ -0,0 +1,265 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Azure.Maps.Weather.Models +{ + using Newtonsoft.Json; + using System.Linq; + + public partial class DayOrNight + { + /// + /// Initializes a new instance of the DayOrNight class. + /// + public DayOrNight() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the DayOrNight class. + /// + /// Phrase description of the icon. Displayed + /// in specified language. For example, 'Sunny'. + /// Indicates the presence or absence of + /// precipitation. True indicates the presence of precipitation, false + /// indicates the absence of precipitation. + /// Possible values include: 'Rain', + /// 'Snow', 'Ice', 'Mix' + /// Description of the + /// intensity. + /// Phrase description of the forecast + /// in specified language. Azure Maps attempts to keep this phrase + /// under 30 characters in length, but some languages/weather events + /// may result in a longer phrase length, exceeding 30 + /// characters. + /// Phrase description of the forecast in + /// specified language. Azure Maps attempts to keep this phrase under + /// 100 characters in length, but some languages/weather events may + /// result in a longer phrase length, exceeding 100 characters. + /// Percent representing the + /// probability of precipitation. For example, '20'. + /// Percent representing the + /// probability of a thunderstorm. For example, '80'. + /// Percent representing the probability + /// of rain. For example, '40'. + /// Percent representing the probability + /// of snow. For example, '30'. + /// Percent representing the probability + /// of ice. For example, '30'. + /// Wind details being returned including speed and + /// direction. + /// Wind gust. Wind gust is a sudden, brief + /// increase in speed of the wind. + /// Total liquid equivalent of precipitation + /// during the forecast period. + /// Rain + /// Snow + /// Ice + /// Hours of precipitation + /// Hours of rain. + /// Hours of snow. + /// Hours of ice. + /// Percent representing cloud cover. + public DayOrNight(int? iconCode = default(int?), string iconPhrase = default(string), LocalSource localSource = default(LocalSource), bool? hasPrecipitation = default(bool?), string precipitationType = default(string), string precipitationIntensity = default(string), string shortDescription = default(string), string longPhrase = default(string), int? precipitationProbability = default(int?), int? thunderstormProbability = default(int?), int? rainProbability = default(int?), int? snowProbability = default(int?), int? iceProbability = default(int?), WindDetails wind = default(WindDetails), WindDetails windGust = default(WindDetails), WeatherUnit totalLiquid = default(WeatherUnit), WeatherUnit rain = default(WeatherUnit), WeatherUnit snow = default(WeatherUnit), WeatherUnit ice = default(WeatherUnit), double? hoursOfPrecipitation = default(double?), double? hoursOfRain = default(double?), double? hoursOfSnow = default(double?), double? hoursOfIce = default(double?), int? cloudCover = default(int?)) + { + IconCode = iconCode; + IconPhrase = iconPhrase; + LocalSource = localSource; + HasPrecipitation = hasPrecipitation; + PrecipitationType = precipitationType; + PrecipitationIntensity = precipitationIntensity; + ShortDescription = shortDescription; + LongPhrase = longPhrase; + PrecipitationProbability = precipitationProbability; + ThunderstormProbability = thunderstormProbability; + RainProbability = rainProbability; + SnowProbability = snowProbability; + IceProbability = iceProbability; + Wind = wind; + WindGust = windGust; + TotalLiquid = totalLiquid; + Rain = rain; + Snow = snow; + Ice = ice; + HoursOfPrecipitation = hoursOfPrecipitation; + HoursOfRain = hoursOfRain; + HoursOfSnow = hoursOfSnow; + HoursOfIce = hoursOfIce; + CloudCover = cloudCover; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// + [JsonProperty(PropertyName = "iconCode")] + public int? IconCode { get; set; } + + /// + /// Gets or sets phrase description of the icon. Displayed in specified + /// language. For example, 'Sunny'. + /// + [JsonProperty(PropertyName = "iconPhrase")] + public string IconPhrase { get; set; } + + /// + /// + [JsonProperty(PropertyName = "localSource")] + public LocalSource LocalSource { get; set; } + + /// + /// Gets or sets indicates the presence or absence of precipitation. + /// True indicates the presence of precipitation, false indicates the + /// absence of precipitation. + /// + [JsonProperty(PropertyName = "hasPrecipitation")] + public bool? HasPrecipitation { get; set; } + + /// + /// Gets or sets possible values include: 'Rain', 'Snow', 'Ice', 'Mix' + /// + [JsonProperty(PropertyName = "precipitationType")] + public string PrecipitationType { get; set; } + + /// + /// Gets or sets description of the intensity. + /// + [JsonProperty(PropertyName = "precipitationIntensity")] + public string PrecipitationIntensity { get; set; } + + /// + /// Gets or sets phrase description of the forecast in specified + /// language. Azure Maps attempts to keep this phrase under 30 + /// characters in length, but some languages/weather events may result + /// in a longer phrase length, exceeding 30 characters. + /// + [JsonProperty(PropertyName = "shortPhrase")] + public string ShortDescription { get; set; } + + /// + /// Gets or sets phrase description of the forecast in specified + /// language. Azure Maps attempts to keep this phrase under 100 + /// characters in length, but some languages/weather events may result + /// in a longer phrase length, exceeding 100 characters. + /// + [JsonProperty(PropertyName = "longPhrase")] + public string LongPhrase { get; set; } + + /// + /// Gets or sets percent representing the probability of precipitation. + /// For example, '20'. + /// + [JsonProperty(PropertyName = "precipitationProbability")] + public int? PrecipitationProbability { get; set; } + + /// + /// Gets or sets percent representing the probability of a + /// thunderstorm. For example, '80'. + /// + [JsonProperty(PropertyName = "thunderstormProbability")] + public int? ThunderstormProbability { get; set; } + + /// + /// Gets or sets percent representing the probability of rain. For + /// example, '40'. + /// + [JsonProperty(PropertyName = "rainProbability")] + public int? RainProbability { get; set; } + + /// + /// Gets or sets percent representing the probability of snow. For + /// example, '30'. + /// + [JsonProperty(PropertyName = "snowProbability")] + public int? SnowProbability { get; set; } + + /// + /// Gets or sets percent representing the probability of ice. For + /// example, '30'. + /// + [JsonProperty(PropertyName = "iceProbability")] + public int? IceProbability { get; set; } + + /// + /// Gets or sets wind details being returned including speed and + /// direction. + /// + [JsonProperty(PropertyName = "wind")] + public WindDetails Wind { get; set; } + + /// + /// Gets or sets wind gust. Wind gust is a sudden, brief increase in + /// speed of the wind. + /// + [JsonProperty(PropertyName = "windGust")] + public WindDetails WindGust { get; set; } + + /// + /// Gets or sets total liquid equivalent of precipitation during the + /// forecast period. + /// + [JsonProperty(PropertyName = "totalLiquid")] + public WeatherUnit TotalLiquid { get; set; } + + /// + /// Gets or sets rain + /// + [JsonProperty(PropertyName = "rain")] + public WeatherUnit Rain { get; set; } + + /// + /// Gets or sets snow + /// + [JsonProperty(PropertyName = "snow")] + public WeatherUnit Snow { get; set; } + + /// + /// Gets or sets ice + /// + [JsonProperty(PropertyName = "ice")] + public WeatherUnit Ice { get; set; } + + /// + /// Gets or sets hours of precipitation + /// + [JsonProperty(PropertyName = "hoursOfPrecipitation")] + public double? HoursOfPrecipitation { get; set; } + + /// + /// Gets or sets hours of rain. + /// + [JsonProperty(PropertyName = "hoursOfRain")] + public double? HoursOfRain { get; set; } + + /// + /// Gets or sets hours of snow. + /// + [JsonProperty(PropertyName = "hoursOfSnow")] + public double? HoursOfSnow { get; set; } + + /// + /// Gets or sets hours of ice. + /// + [JsonProperty(PropertyName = "hoursOfIce")] + public double? HoursOfIce { get; set; } + + /// + /// Gets or sets percent representing cloud cover. + /// + [JsonProperty(PropertyName = "cloudCover")] + public int? CloudCover { get; set; } + + } +} diff --git a/sdk/maps/Azure.Maps.Weather/src/Generated/Models/DegreeDaySummary.cs b/sdk/maps/Azure.Maps.Weather/src/Generated/Models/DegreeDaySummary.cs new file mode 100644 index 000000000000..c667571f6c19 --- /dev/null +++ b/sdk/maps/Azure.Maps.Weather/src/Generated/Models/DegreeDaySummary.cs @@ -0,0 +1,60 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Azure.Maps.Weather.Models +{ + using Newtonsoft.Json; + using System.Linq; + + public partial class DegreeDaySummary + { + /// + /// Initializes a new instance of the DegreeDaySummary class. + /// + public DegreeDaySummary() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the DegreeDaySummary class. + /// + /// Number of degrees that the mean temperature + /// is below 65 degrees F/ 18 degree C. + /// Number of degrees that the mean temperature + /// is above 65 degrees F/ 18 degree C. + public DegreeDaySummary(WeatherUnit heating = default(WeatherUnit), WeatherUnit cooling = default(WeatherUnit)) + { + Heating = heating; + Cooling = cooling; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets number of degrees that the mean temperature is below + /// 65 degrees F/ 18 degree C. + /// + [JsonProperty(PropertyName = "heating")] + public WeatherUnit Heating { get; set; } + + /// + /// Gets or sets number of degrees that the mean temperature is above + /// 65 degrees F/ 18 degree C. + /// + [JsonProperty(PropertyName = "cooling")] + public WeatherUnit Cooling { get; set; } + + } +} diff --git a/sdk/maps/Azure.Maps.Weather/src/Generated/Models/DominantPollutant.cs b/sdk/maps/Azure.Maps.Weather/src/Generated/Models/DominantPollutant.cs new file mode 100644 index 000000000000..0fb62f5aec3b --- /dev/null +++ b/sdk/maps/Azure.Maps.Weather/src/Generated/Models/DominantPollutant.cs @@ -0,0 +1,44 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Azure.Maps.Weather.Models +{ + + /// + /// Defines values for DominantPollutant. + /// + public static class DominantPollutant + { + /// + /// Carbon monoxide ("CO") + /// + public const string CarbonMonoxide = "Carbon Monoxide"; + /// + /// Nitrogen dioxide ("NO2") + /// + public const string NitrogenDioxide = "Nitrogen Dioxide"; + /// + /// Ozone ("O3") + /// + public const string Ozone = "Ozone"; + /// + /// Particulate matter 2.5 ("PM2.5") + /// + public const string ParticulateMatter25 = "Particulate Matter 2.5"; + /// + /// Particulate matter 10 ("PM10") + /// + public const string ParticulateMatter10 = "Particulate Matter 10"; + /// + /// Sulfur dioxide ("SO2") + /// + public const string SulfurDioxide = "Sulfur Dioxide"; + } +} diff --git a/sdk/maps/Azure.Maps.Weather/src/Generated/Models/ErrorAdditionalInfo.cs b/sdk/maps/Azure.Maps.Weather/src/Generated/Models/ErrorAdditionalInfo.cs new file mode 100644 index 000000000000..68872685862d --- /dev/null +++ b/sdk/maps/Azure.Maps.Weather/src/Generated/Models/ErrorAdditionalInfo.cs @@ -0,0 +1,59 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Azure.Maps.Weather.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// The resource management error additional info. + /// + public partial class ErrorAdditionalInfo + { + /// + /// Initializes a new instance of the ErrorAdditionalInfo class. + /// + public ErrorAdditionalInfo() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the ErrorAdditionalInfo class. + /// + /// The additional info type. + /// The additional info. + public ErrorAdditionalInfo(string type = default(string), object info = default(object)) + { + Type = type; + Info = info; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets the additional info type. + /// + [JsonProperty(PropertyName = "type")] + public string Type { get; private set; } + + /// + /// Gets the additional info. + /// + [JsonProperty(PropertyName = "info")] + public object Info { get; private set; } + + } +} diff --git a/sdk/maps/Azure.Maps.Weather/src/Generated/Models/ErrorDetail.cs b/sdk/maps/Azure.Maps.Weather/src/Generated/Models/ErrorDetail.cs new file mode 100644 index 000000000000..78c3ab5a0852 --- /dev/null +++ b/sdk/maps/Azure.Maps.Weather/src/Generated/Models/ErrorDetail.cs @@ -0,0 +1,85 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Azure.Maps.Weather.Models +{ + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// The error detail. + /// + public partial class ErrorDetail + { + /// + /// Initializes a new instance of the ErrorDetail class. + /// + public ErrorDetail() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the ErrorDetail class. + /// + /// The error code. + /// The error message. + /// The error target. + /// The error details. + /// The error additional info. + public ErrorDetail(string code = default(string), string message = default(string), string target = default(string), IList details = default(IList), IList additionalInfo = default(IList)) + { + Code = code; + Message = message; + Target = target; + Details = details; + AdditionalInfo = additionalInfo; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets the error code. + /// + [JsonProperty(PropertyName = "code")] + public string Code { get; private set; } + + /// + /// Gets the error message. + /// + [JsonProperty(PropertyName = "message")] + public string Message { get; private set; } + + /// + /// Gets the error target. + /// + [JsonProperty(PropertyName = "target")] + public string Target { get; private set; } + + /// + /// Gets the error details. + /// + [JsonProperty(PropertyName = "details")] + public IList Details { get; private set; } + + /// + /// Gets the error additional info. + /// + [JsonProperty(PropertyName = "additionalInfo")] + public IList AdditionalInfo { get; private set; } + + } +} diff --git a/sdk/maps/Azure.Maps.Weather/src/Generated/Models/ErrorResponse.cs b/sdk/maps/Azure.Maps.Weather/src/Generated/Models/ErrorResponse.cs new file mode 100644 index 000000000000..f97fdb0bf397 --- /dev/null +++ b/sdk/maps/Azure.Maps.Weather/src/Generated/Models/ErrorResponse.cs @@ -0,0 +1,56 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Azure.Maps.Weather.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Error response + /// + /// + /// Common error response for all Azure Resource Manager APIs to return + /// error details for failed operations. (This also follows the OData error + /// response format.). + /// + public partial class ErrorResponse + { + /// + /// Initializes a new instance of the ErrorResponse class. + /// + public ErrorResponse() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the ErrorResponse class. + /// + /// The error object. + public ErrorResponse(ErrorDetail error = default(ErrorDetail)) + { + Error = error; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the error object. + /// + [JsonProperty(PropertyName = "error")] + public ErrorDetail Error { get; set; } + + } +} diff --git a/sdk/maps/Azure.Maps.Weather/src/Generated/Models/ErrorResponseException.cs b/sdk/maps/Azure.Maps.Weather/src/Generated/Models/ErrorResponseException.cs new file mode 100644 index 000000000000..c1ae702848d1 --- /dev/null +++ b/sdk/maps/Azure.Maps.Weather/src/Generated/Models/ErrorResponseException.cs @@ -0,0 +1,62 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Azure.Maps.Weather.Models +{ + using Microsoft.Rest; + + /// + /// Exception thrown for an invalid response with ErrorResponse + /// information. + /// + public partial class ErrorResponseException : RestException + { + /// + /// Gets information about the associated HTTP request. + /// + public HttpRequestMessageWrapper Request { get; set; } + + /// + /// Gets information about the associated HTTP response. + /// + public HttpResponseMessageWrapper Response { get; set; } + + /// + /// Gets or sets the body object. + /// + public ErrorResponse Body { get; set; } + + /// + /// Initializes a new instance of the ErrorResponseException class. + /// + public ErrorResponseException() + { + } + + /// + /// Initializes a new instance of the ErrorResponseException class. + /// + /// The exception message. + public ErrorResponseException(string message) + : this(message, null) + { + } + + /// + /// Initializes a new instance of the ErrorResponseException class. + /// + /// The exception message. + /// Inner exception. + public ErrorResponseException(string message, System.Exception innerException) + : base(message, innerException) + { + } + } +} diff --git a/sdk/maps/Azure.Maps.Weather/src/Generated/Models/ForecastInterval.cs b/sdk/maps/Azure.Maps.Weather/src/Generated/Models/ForecastInterval.cs new file mode 100644 index 000000000000..da843c834f86 --- /dev/null +++ b/sdk/maps/Azure.Maps.Weather/src/Generated/Models/ForecastInterval.cs @@ -0,0 +1,138 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Azure.Maps.Weather.Models +{ + using Newtonsoft.Json; + using System.Linq; + + public partial class ForecastInterval + { + /// + /// Initializes a new instance of the ForecastInterval class. + /// + public ForecastInterval() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the ForecastInterval class. + /// + /// The date and time for the start of the + /// interval in ISO 8601 format, for example, + /// 2019-10-27T19:39:57-08:00. + /// The first minute for the interval. + /// A unit that represents forecasted + /// precipitation intensity. + /// A short phrase describing + /// precipitation condition for the interval. + /// Key that specifies the threshold value. + /// Along with precipitationType, can be used to determine the + /// simplifiedColor. If dbz is zero, not present in the + /// response. + /// The full spectrum color that maps to the dBZ + /// (decibel relative to Z). If dbz is zero, color is not present in + /// the response. + /// The band color that maps to the + /// precipitation type and threshold. If dbz is zero, not present in + /// the response. + /// Possible values include: 'Rain', + /// 'Snow', 'Ice', 'Mix' + /// Percent representing cloud cover. + public ForecastInterval(System.DateTime? startTime = default(System.DateTime?), int? minute = default(int?), double? decibelRelativeToZ = default(double?), string shortDescription = default(string), string threshold = default(string), ColorValue color = default(ColorValue), ColorValue simplifiedColor = default(ColorValue), string precipitationType = default(string), int? iconCode = default(int?), int? cloudCover = default(int?)) + { + StartTime = startTime; + Minute = minute; + DecibelRelativeToZ = decibelRelativeToZ; + ShortDescription = shortDescription; + Threshold = threshold; + Color = color; + SimplifiedColor = simplifiedColor; + PrecipitationType = precipitationType; + IconCode = iconCode; + CloudCover = cloudCover; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the date and time for the start of the interval in ISO + /// 8601 format, for example, 2019-10-27T19:39:57-08:00. + /// + [JsonProperty(PropertyName = "startTime")] + public System.DateTime? StartTime { get; set; } + + /// + /// Gets or sets the first minute for the interval. + /// + [JsonProperty(PropertyName = "minute")] + public int? Minute { get; set; } + + /// + /// Gets or sets a unit that represents forecasted precipitation + /// intensity. + /// + [JsonProperty(PropertyName = "dbz")] + public double? DecibelRelativeToZ { get; set; } + + /// + /// Gets or sets a short phrase describing precipitation condition for + /// the interval. + /// + [JsonProperty(PropertyName = "shortPhrase")] + public string ShortDescription { get; set; } + + /// + /// Gets or sets key that specifies the threshold value. Along with + /// precipitationType, can be used to determine the simplifiedColor. If + /// dbz is zero, not present in the response. + /// + [JsonProperty(PropertyName = "threshold")] + public string Threshold { get; set; } + + /// + /// Gets or sets the full spectrum color that maps to the dBZ (decibel + /// relative to Z). If dbz is zero, color is not present in the + /// response. + /// + [JsonProperty(PropertyName = "color")] + public ColorValue Color { get; set; } + + /// + /// Gets or sets the band color that maps to the precipitation type and + /// threshold. If dbz is zero, not present in the response. + /// + [JsonProperty(PropertyName = "simplifiedColor")] + public ColorValue SimplifiedColor { get; set; } + + /// + /// Gets or sets possible values include: 'Rain', 'Snow', 'Ice', 'Mix' + /// + [JsonProperty(PropertyName = "precipitationType")] + public string PrecipitationType { get; set; } + + /// + /// + [JsonProperty(PropertyName = "iconCode")] + public int? IconCode { get; set; } + + /// + /// Gets or sets percent representing cloud cover. + /// + [JsonProperty(PropertyName = "cloudCover")] + public int? CloudCover { get; set; } + + } +} diff --git a/sdk/maps/Azure.Maps.Weather/src/Generated/Models/GeoJsonFeature.cs b/sdk/maps/Azure.Maps.Weather/src/Generated/Models/GeoJsonFeature.cs new file mode 100644 index 000000000000..5905a6f3d2f6 --- /dev/null +++ b/sdk/maps/Azure.Maps.Weather/src/Generated/Models/GeoJsonFeature.cs @@ -0,0 +1,117 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Azure.Maps.Weather.Models +{ + using Microsoft.Rest; + using Newtonsoft.Json; + using System.Linq; + + /// + /// A valid `GeoJSON Feature` object type. Please refer to [RFC + /// 7946](https://tools.ietf.org/html/rfc7946#section-3.2) for details. + /// + public partial class GeoJsonFeature + { + /// + /// Initializes a new instance of the GeoJsonFeature class. + /// + public GeoJsonFeature() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the GeoJsonFeature class. + /// + /// Specifies the `GeoJSON` type. Must be one of the + /// nine valid GeoJSON object types - Point, MultiPoint, LineString, + /// MultiLineString, Polygon, MultiPolygon, GeometryCollection, Feature + /// and FeatureCollection. Possible values include: 'GeoJsonPoint', + /// 'GeoJsonMultiPoint', 'GeoJsonLineString', 'GeoJsonMultiLineString', + /// 'GeoJsonPolygon', 'GeoJsonMultiPolygon', + /// 'GeoJsonGeometryCollection', 'GeoJsonFeature', + /// 'GeoJsonFeatureCollection' + /// Properties can contain any additional + /// metadata about the `Feature`. Value can be any JSON object or a + /// JSON null value + /// Identifier for the feature. + /// The type of the feature. The value + /// depends on the data model the current feature is part of. Some data + /// models may have an empty value. + public GeoJsonFeature(GeoJsonObjectType type, GeoJsonGeometry geometry, object properties = default(object), string id = default(string), string featureType = default(string)) + { + Type = type; + Geometry = geometry; + Properties = properties; + Id = id; + FeatureType = featureType; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets specifies the `GeoJSON` type. Must be one of the nine + /// valid GeoJSON object types - Point, MultiPoint, LineString, + /// MultiLineString, Polygon, MultiPolygon, GeometryCollection, Feature + /// and FeatureCollection. Possible values include: 'GeoJsonPoint', + /// 'GeoJsonMultiPoint', 'GeoJsonLineString', 'GeoJsonMultiLineString', + /// 'GeoJsonPolygon', 'GeoJsonMultiPolygon', + /// 'GeoJsonGeometryCollection', 'GeoJsonFeature', + /// 'GeoJsonFeatureCollection' + /// + [JsonProperty(PropertyName = "type")] + public GeoJsonObjectType Type { get; set; } + + /// + /// + [JsonProperty(PropertyName = "geometry")] + public GeoJsonGeometry Geometry { get; set; } + + /// + /// Gets or sets properties can contain any additional metadata about + /// the `Feature`. Value can be any JSON object or a JSON null value + /// + [JsonProperty(PropertyName = "properties")] + public object Properties { get; set; } + + /// + /// Gets or sets identifier for the feature. + /// + [JsonProperty(PropertyName = "id")] + public string Id { get; set; } + + /// + /// Gets or sets the type of the feature. The value depends on the data + /// model the current feature is part of. Some data models may have an + /// empty value. + /// + [JsonProperty(PropertyName = "featureType")] + public string FeatureType { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (Geometry == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "Geometry"); + } + } + } +} diff --git a/sdk/maps/Azure.Maps.Weather/src/Generated/Models/GeoJsonFeatureCollection.cs b/sdk/maps/Azure.Maps.Weather/src/Generated/Models/GeoJsonFeatureCollection.cs new file mode 100644 index 000000000000..ac52d8c68fef --- /dev/null +++ b/sdk/maps/Azure.Maps.Weather/src/Generated/Models/GeoJsonFeatureCollection.cs @@ -0,0 +1,101 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Azure.Maps.Weather.Models +{ + using Microsoft.Rest; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// A valid `GeoJSON FeatureCollection` object type. Please refer to [RFC + /// 7946](https://tools.ietf.org/html/rfc7946#section-3.3) for details. + /// + public partial class GeoJsonFeatureCollection + { + /// + /// Initializes a new instance of the GeoJsonFeatureCollection class. + /// + public GeoJsonFeatureCollection() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the GeoJsonFeatureCollection class. + /// + /// Specifies the `GeoJSON` type. Must be one of the + /// nine valid GeoJSON object types - Point, MultiPoint, LineString, + /// MultiLineString, Polygon, MultiPolygon, GeometryCollection, Feature + /// and FeatureCollection. Possible values include: 'GeoJsonPoint', + /// 'GeoJsonMultiPoint', 'GeoJsonLineString', 'GeoJsonMultiLineString', + /// 'GeoJsonPolygon', 'GeoJsonMultiPolygon', + /// 'GeoJsonGeometryCollection', 'GeoJsonFeature', + /// 'GeoJsonFeatureCollection' + /// Contains a list of valid `GeoJSON Feature` + /// objects. + public GeoJsonFeatureCollection(GeoJsonObjectType type, IList features) + { + Type = type; + Features = features; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets specifies the `GeoJSON` type. Must be one of the nine + /// valid GeoJSON object types - Point, MultiPoint, LineString, + /// MultiLineString, Polygon, MultiPolygon, GeometryCollection, Feature + /// and FeatureCollection. Possible values include: 'GeoJsonPoint', + /// 'GeoJsonMultiPoint', 'GeoJsonLineString', 'GeoJsonMultiLineString', + /// 'GeoJsonPolygon', 'GeoJsonMultiPolygon', + /// 'GeoJsonGeometryCollection', 'GeoJsonFeature', + /// 'GeoJsonFeatureCollection' + /// + [JsonProperty(PropertyName = "type")] + public GeoJsonObjectType Type { get; set; } + + /// + /// Gets or sets contains a list of valid `GeoJSON Feature` objects. + /// + [JsonProperty(PropertyName = "features")] + public IList Features { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (Features == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "Features"); + } + if (Features != null) + { + foreach (var element in Features) + { + if (element != null) + { + element.Validate(); + } + } + } + } + } +} diff --git a/sdk/maps/Azure.Maps.Weather/src/Generated/Models/GeoJsonFeatureCollectionData.cs b/sdk/maps/Azure.Maps.Weather/src/Generated/Models/GeoJsonFeatureCollectionData.cs new file mode 100644 index 000000000000..a541698f677d --- /dev/null +++ b/sdk/maps/Azure.Maps.Weather/src/Generated/Models/GeoJsonFeatureCollectionData.cs @@ -0,0 +1,77 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Azure.Maps.Weather.Models +{ + using Microsoft.Rest; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + public partial class GeoJsonFeatureCollectionData + { + /// + /// Initializes a new instance of the GeoJsonFeatureCollectionData + /// class. + /// + public GeoJsonFeatureCollectionData() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the GeoJsonFeatureCollectionData + /// class. + /// + /// Contains a list of valid `GeoJSON Feature` + /// objects. + public GeoJsonFeatureCollectionData(IList features) + { + Features = features; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets contains a list of valid `GeoJSON Feature` objects. + /// + [JsonProperty(PropertyName = "features")] + public IList Features { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (Features == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "Features"); + } + if (Features != null) + { + foreach (var element in Features) + { + if (element != null) + { + element.Validate(); + } + } + } + } + } +} diff --git a/sdk/maps/Azure.Maps.Weather/src/Generated/Models/GeoJsonFeatureData.cs b/sdk/maps/Azure.Maps.Weather/src/Generated/Models/GeoJsonFeatureData.cs new file mode 100644 index 000000000000..184580d327e2 --- /dev/null +++ b/sdk/maps/Azure.Maps.Weather/src/Generated/Models/GeoJsonFeatureData.cs @@ -0,0 +1,91 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Azure.Maps.Weather.Models +{ + using Microsoft.Rest; + using Newtonsoft.Json; + using System.Linq; + + public partial class GeoJsonFeatureData + { + /// + /// Initializes a new instance of the GeoJsonFeatureData class. + /// + public GeoJsonFeatureData() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the GeoJsonFeatureData class. + /// + /// Properties can contain any additional + /// metadata about the `Feature`. Value can be any JSON object or a + /// JSON null value + /// Identifier for the feature. + /// The type of the feature. The value + /// depends on the data model the current feature is part of. Some data + /// models may have an empty value. + public GeoJsonFeatureData(GeoJsonGeometry geometry, object properties = default(object), string id = default(string), string featureType = default(string)) + { + Geometry = geometry; + Properties = properties; + Id = id; + FeatureType = featureType; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// + [JsonProperty(PropertyName = "geometry")] + public GeoJsonGeometry Geometry { get; set; } + + /// + /// Gets or sets properties can contain any additional metadata about + /// the `Feature`. Value can be any JSON object or a JSON null value + /// + [JsonProperty(PropertyName = "properties")] + public object Properties { get; set; } + + /// + /// Gets or sets identifier for the feature. + /// + [JsonProperty(PropertyName = "id")] + public string Id { get; set; } + + /// + /// Gets or sets the type of the feature. The value depends on the data + /// model the current feature is part of. Some data models may have an + /// empty value. + /// + [JsonProperty(PropertyName = "featureType")] + public string FeatureType { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (Geometry == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "Geometry"); + } + } + } +} diff --git a/sdk/maps/Azure.Maps.Weather/src/Generated/Models/GeoJsonGeometry.cs b/sdk/maps/Azure.Maps.Weather/src/Generated/Models/GeoJsonGeometry.cs new file mode 100644 index 000000000000..cd6679dd287d --- /dev/null +++ b/sdk/maps/Azure.Maps.Weather/src/Generated/Models/GeoJsonGeometry.cs @@ -0,0 +1,39 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Azure.Maps.Weather.Models +{ + using System.Linq; + + /// + /// A valid `GeoJSON` geometry object. The type must be one of the seven + /// valid GeoJSON geometry types - Point, MultiPoint, LineString, + /// MultiLineString, Polygon, MultiPolygon and GeometryCollection. Please + /// refer to [RFC 7946](https://tools.ietf.org/html/rfc7946#section-3.1) + /// for details. + /// + public partial class GeoJsonGeometry : GeoJsonObject + { + /// + /// Initializes a new instance of the GeoJsonGeometry class. + /// + public GeoJsonGeometry() + { + CustomInit(); + } + + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + } +} diff --git a/sdk/maps/Azure.Maps.Weather/src/Generated/Models/GeoJsonGeometryCollection.cs b/sdk/maps/Azure.Maps.Weather/src/Generated/Models/GeoJsonGeometryCollection.cs new file mode 100644 index 000000000000..6905f414c03f --- /dev/null +++ b/sdk/maps/Azure.Maps.Weather/src/Generated/Models/GeoJsonGeometryCollection.cs @@ -0,0 +1,72 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Azure.Maps.Weather.Models +{ + using Microsoft.Rest; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// A valid `GeoJSON GeometryCollection` object type. Please refer to [RFC + /// 7946](https://tools.ietf.org/html/rfc7946#section-3.1.8) for details. + /// + public partial class GeoJsonGeometryCollection + { + /// + /// Initializes a new instance of the GeoJsonGeometryCollection class. + /// + public GeoJsonGeometryCollection() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the GeoJsonGeometryCollection class. + /// + /// Contains a list of valid `GeoJSON` + /// geometry objects. **Note** that coordinates in GeoJSON are in x, y + /// order (longitude, latitude). + public GeoJsonGeometryCollection(IList geometries) + { + Geometries = geometries; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets contains a list of valid `GeoJSON` geometry objects. + /// **Note** that coordinates in GeoJSON are in x, y order (longitude, + /// latitude). + /// + [JsonProperty(PropertyName = "geometries")] + public IList Geometries { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (Geometries == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "Geometries"); + } + } + } +} diff --git a/sdk/maps/Azure.Maps.Weather/src/Generated/Models/GeoJsonGeometryCollectionData.cs b/sdk/maps/Azure.Maps.Weather/src/Generated/Models/GeoJsonGeometryCollectionData.cs new file mode 100644 index 000000000000..e8d6caf258e7 --- /dev/null +++ b/sdk/maps/Azure.Maps.Weather/src/Generated/Models/GeoJsonGeometryCollectionData.cs @@ -0,0 +1,70 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Azure.Maps.Weather.Models +{ + using Microsoft.Rest; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + public partial class GeoJsonGeometryCollectionData + { + /// + /// Initializes a new instance of the GeoJsonGeometryCollectionData + /// class. + /// + public GeoJsonGeometryCollectionData() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the GeoJsonGeometryCollectionData + /// class. + /// + /// Contains a list of valid `GeoJSON` + /// geometry objects. **Note** that coordinates in GeoJSON are in x, y + /// order (longitude, latitude). + public GeoJsonGeometryCollectionData(IList geometries) + { + Geometries = geometries; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets contains a list of valid `GeoJSON` geometry objects. + /// **Note** that coordinates in GeoJSON are in x, y order (longitude, + /// latitude). + /// + [JsonProperty(PropertyName = "geometries")] + public IList Geometries { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (Geometries == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "Geometries"); + } + } + } +} diff --git a/sdk/maps/Azure.Maps.Weather/src/Generated/Models/GeoJsonLineString.cs b/sdk/maps/Azure.Maps.Weather/src/Generated/Models/GeoJsonLineString.cs new file mode 100644 index 000000000000..150b6dd1fae7 --- /dev/null +++ b/sdk/maps/Azure.Maps.Weather/src/Generated/Models/GeoJsonLineString.cs @@ -0,0 +1,69 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Azure.Maps.Weather.Models +{ + using Microsoft.Rest; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// A valid `GeoJSON LineString` geometry type. Please refer to [RFC + /// 7946](https://tools.ietf.org/html/rfc7946#section-3.1.4) for details. + /// + public partial class GeoJsonLineString + { + /// + /// Initializes a new instance of the GeoJsonLineString class. + /// + public GeoJsonLineString() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the GeoJsonLineString class. + /// + /// Coordinates for the `GeoJson LineString` + /// geometry. + public GeoJsonLineString(IList> coordinates) + { + Coordinates = coordinates; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets coordinates for the `GeoJson LineString` geometry. + /// + [JsonProperty(PropertyName = "coordinates")] + public IList> Coordinates { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (Coordinates == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "Coordinates"); + } + } + } +} diff --git a/sdk/maps/Azure.Maps.Weather/src/Generated/Models/GeoJsonLineStringData.cs b/sdk/maps/Azure.Maps.Weather/src/Generated/Models/GeoJsonLineStringData.cs new file mode 100644 index 000000000000..04b3558bf9f5 --- /dev/null +++ b/sdk/maps/Azure.Maps.Weather/src/Generated/Models/GeoJsonLineStringData.cs @@ -0,0 +1,65 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Azure.Maps.Weather.Models +{ + using Microsoft.Rest; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + public partial class GeoJsonLineStringData + { + /// + /// Initializes a new instance of the GeoJsonLineStringData class. + /// + public GeoJsonLineStringData() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the GeoJsonLineStringData class. + /// + /// Coordinates for the `GeoJson LineString` + /// geometry. + public GeoJsonLineStringData(IList> coordinates) + { + Coordinates = coordinates; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets coordinates for the `GeoJson LineString` geometry. + /// + [JsonProperty(PropertyName = "coordinates")] + public IList> Coordinates { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (Coordinates == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "Coordinates"); + } + } + } +} diff --git a/sdk/maps/Azure.Maps.Weather/src/Generated/Models/GeoJsonMultiLineString.cs b/sdk/maps/Azure.Maps.Weather/src/Generated/Models/GeoJsonMultiLineString.cs new file mode 100644 index 000000000000..8f4dbc74d622 --- /dev/null +++ b/sdk/maps/Azure.Maps.Weather/src/Generated/Models/GeoJsonMultiLineString.cs @@ -0,0 +1,70 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Azure.Maps.Weather.Models +{ + using Microsoft.Rest; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// A valid `GeoJSON MultiLineString` geometry type. Please refer to [RFC + /// 7946](https://tools.ietf.org/html/rfc7946#section-3.1.5) for details. + /// + public partial class GeoJsonMultiLineString + { + /// + /// Initializes a new instance of the GeoJsonMultiLineString class. + /// + public GeoJsonMultiLineString() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the GeoJsonMultiLineString class. + /// + /// Coordinates for the `GeoJson + /// MultiLineString` geometry. + public GeoJsonMultiLineString(IList>> coordinates) + { + Coordinates = coordinates; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets coordinates for the `GeoJson MultiLineString` + /// geometry. + /// + [JsonProperty(PropertyName = "coordinates")] + public IList>> Coordinates { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (Coordinates == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "Coordinates"); + } + } + } +} diff --git a/sdk/maps/Azure.Maps.Weather/src/Generated/Models/GeoJsonMultiLineStringData.cs b/sdk/maps/Azure.Maps.Weather/src/Generated/Models/GeoJsonMultiLineStringData.cs new file mode 100644 index 000000000000..5244eff36cbe --- /dev/null +++ b/sdk/maps/Azure.Maps.Weather/src/Generated/Models/GeoJsonMultiLineStringData.cs @@ -0,0 +1,66 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Azure.Maps.Weather.Models +{ + using Microsoft.Rest; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + public partial class GeoJsonMultiLineStringData + { + /// + /// Initializes a new instance of the GeoJsonMultiLineStringData class. + /// + public GeoJsonMultiLineStringData() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the GeoJsonMultiLineStringData class. + /// + /// Coordinates for the `GeoJson + /// MultiLineString` geometry. + public GeoJsonMultiLineStringData(IList>> coordinates) + { + Coordinates = coordinates; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets coordinates for the `GeoJson MultiLineString` + /// geometry. + /// + [JsonProperty(PropertyName = "coordinates")] + public IList>> Coordinates { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (Coordinates == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "Coordinates"); + } + } + } +} diff --git a/sdk/maps/Azure.Maps.Weather/src/Generated/Models/GeoJsonMultiPoint.cs b/sdk/maps/Azure.Maps.Weather/src/Generated/Models/GeoJsonMultiPoint.cs new file mode 100644 index 000000000000..260f327505a5 --- /dev/null +++ b/sdk/maps/Azure.Maps.Weather/src/Generated/Models/GeoJsonMultiPoint.cs @@ -0,0 +1,69 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Azure.Maps.Weather.Models +{ + using Microsoft.Rest; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// A valid `GeoJSON MultiPoint` geometry type. Please refer to [RFC + /// 7946](https://tools.ietf.org/html/rfc7946#section-3.1.3) for details. + /// + public partial class GeoJsonMultiPoint + { + /// + /// Initializes a new instance of the GeoJsonMultiPoint class. + /// + public GeoJsonMultiPoint() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the GeoJsonMultiPoint class. + /// + /// Coordinates for the `GeoJson MultiPoint` + /// geometry. + public GeoJsonMultiPoint(IList> coordinates) + { + Coordinates = coordinates; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets coordinates for the `GeoJson MultiPoint` geometry. + /// + [JsonProperty(PropertyName = "coordinates")] + public IList> Coordinates { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (Coordinates == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "Coordinates"); + } + } + } +} diff --git a/sdk/maps/Azure.Maps.Weather/src/Generated/Models/GeoJsonMultiPointData.cs b/sdk/maps/Azure.Maps.Weather/src/Generated/Models/GeoJsonMultiPointData.cs new file mode 100644 index 000000000000..d086309e737a --- /dev/null +++ b/sdk/maps/Azure.Maps.Weather/src/Generated/Models/GeoJsonMultiPointData.cs @@ -0,0 +1,68 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Azure.Maps.Weather.Models +{ + using Microsoft.Rest; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// Data contained by a `GeoJson MultiPoint`. + /// + public partial class GeoJsonMultiPointData + { + /// + /// Initializes a new instance of the GeoJsonMultiPointData class. + /// + public GeoJsonMultiPointData() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the GeoJsonMultiPointData class. + /// + /// Coordinates for the `GeoJson MultiPoint` + /// geometry. + public GeoJsonMultiPointData(IList> coordinates) + { + Coordinates = coordinates; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets coordinates for the `GeoJson MultiPoint` geometry. + /// + [JsonProperty(PropertyName = "coordinates")] + public IList> Coordinates { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (Coordinates == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "Coordinates"); + } + } + } +} diff --git a/sdk/maps/Azure.Maps.Weather/src/Generated/Models/GeoJsonMultiPolygon.cs b/sdk/maps/Azure.Maps.Weather/src/Generated/Models/GeoJsonMultiPolygon.cs new file mode 100644 index 000000000000..228b19807849 --- /dev/null +++ b/sdk/maps/Azure.Maps.Weather/src/Generated/Models/GeoJsonMultiPolygon.cs @@ -0,0 +1,72 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Azure.Maps.Weather.Models +{ + using Microsoft.Rest; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// A valid `GeoJSON MultiPolygon` object type. Please refer to [RFC + /// 7946](https://tools.ietf.org/html/rfc7946#section-3.1.7) for details. + /// + public partial class GeoJsonMultiPolygon + { + /// + /// Initializes a new instance of the GeoJsonMultiPolygon class. + /// + public GeoJsonMultiPolygon() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the GeoJsonMultiPolygon class. + /// + /// Contains a list of valid `GeoJSON + /// Polygon` objects. **Note** that coordinates in GeoJSON are in x, y + /// order (longitude, latitude). + public GeoJsonMultiPolygon(IList>>> coordinates) + { + Coordinates = coordinates; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets contains a list of valid `GeoJSON Polygon` objects. + /// **Note** that coordinates in GeoJSON are in x, y order (longitude, + /// latitude). + /// + [JsonProperty(PropertyName = "coordinates")] + public IList>>> Coordinates { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (Coordinates == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "Coordinates"); + } + } + } +} diff --git a/sdk/maps/Azure.Maps.Weather/src/Generated/Models/GeoJsonMultiPolygonData.cs b/sdk/maps/Azure.Maps.Weather/src/Generated/Models/GeoJsonMultiPolygonData.cs new file mode 100644 index 000000000000..2a16e7b3aa76 --- /dev/null +++ b/sdk/maps/Azure.Maps.Weather/src/Generated/Models/GeoJsonMultiPolygonData.cs @@ -0,0 +1,68 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Azure.Maps.Weather.Models +{ + using Microsoft.Rest; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + public partial class GeoJsonMultiPolygonData + { + /// + /// Initializes a new instance of the GeoJsonMultiPolygonData class. + /// + public GeoJsonMultiPolygonData() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the GeoJsonMultiPolygonData class. + /// + /// Contains a list of valid `GeoJSON + /// Polygon` objects. **Note** that coordinates in GeoJSON are in x, y + /// order (longitude, latitude). + public GeoJsonMultiPolygonData(IList>>> coordinates) + { + Coordinates = coordinates; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets contains a list of valid `GeoJSON Polygon` objects. + /// **Note** that coordinates in GeoJSON are in x, y order (longitude, + /// latitude). + /// + [JsonProperty(PropertyName = "coordinates")] + public IList>>> Coordinates { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (Coordinates == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "Coordinates"); + } + } + } +} diff --git a/sdk/maps/Azure.Maps.Weather/src/Generated/Models/GeoJsonObject.cs b/sdk/maps/Azure.Maps.Weather/src/Generated/Models/GeoJsonObject.cs new file mode 100644 index 000000000000..5ab03485e2ad --- /dev/null +++ b/sdk/maps/Azure.Maps.Weather/src/Generated/Models/GeoJsonObject.cs @@ -0,0 +1,36 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Azure.Maps.Weather.Models +{ + using System.Linq; + + /// + /// A valid `GeoJSON` object. Please refer to [RFC + /// 7946](https://tools.ietf.org/html/rfc7946#section-3) for details. + /// + public partial class GeoJsonObject + { + /// + /// Initializes a new instance of the GeoJsonObject class. + /// + public GeoJsonObject() + { + CustomInit(); + } + + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + } +} diff --git a/sdk/maps/Azure.Maps.Weather/src/Generated/Models/GeoJsonObjectType.cs b/sdk/maps/Azure.Maps.Weather/src/Generated/Models/GeoJsonObjectType.cs new file mode 100644 index 000000000000..aa716223ad6f --- /dev/null +++ b/sdk/maps/Azure.Maps.Weather/src/Generated/Models/GeoJsonObjectType.cs @@ -0,0 +1,129 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Azure.Maps.Weather.Models +{ + using Newtonsoft.Json; + using Newtonsoft.Json.Converters; + using System.Runtime; + using System.Runtime.Serialization; + + /// + /// Defines values for GeoJsonObjectType. + /// + [JsonConverter(typeof(StringEnumConverter))] + public enum GeoJsonObjectType + { + /// + /// `GeoJSON Point` geometry. + /// + [EnumMember(Value = "Point")] + GeoJsonPoint, + /// + /// `GeoJSON MultiPoint` geometry. + /// + [EnumMember(Value = "MultiPoint")] + GeoJsonMultiPoint, + /// + /// `GeoJSON LineString` geometry. + /// + [EnumMember(Value = "LineString")] + GeoJsonLineString, + /// + /// `GeoJSON MultiLineString` geometry. + /// + [EnumMember(Value = "MultiLineString")] + GeoJsonMultiLineString, + /// + /// `GeoJSON Polygon` geometry. + /// + [EnumMember(Value = "Polygon")] + GeoJsonPolygon, + /// + /// `GeoJSON MultiPolygon` geometry. + /// + [EnumMember(Value = "MultiPolygon")] + GeoJsonMultiPolygon, + /// + /// `GeoJSON GeometryCollection` geometry. + /// + [EnumMember(Value = "GeometryCollection")] + GeoJsonGeometryCollection, + /// + /// `GeoJSON Feature` object. + /// + [EnumMember(Value = "Feature")] + GeoJsonFeature, + /// + /// `GeoJSON FeatureCollection` object. + /// + [EnumMember(Value = "FeatureCollection")] + GeoJsonFeatureCollection + } + internal static class GeoJsonObjectTypeEnumExtension + { + internal static string ToSerializedValue(this GeoJsonObjectType? value) + { + return value == null ? null : ((GeoJsonObjectType)value).ToSerializedValue(); + } + + internal static string ToSerializedValue(this GeoJsonObjectType value) + { + switch( value ) + { + case GeoJsonObjectType.GeoJsonPoint: + return "Point"; + case GeoJsonObjectType.GeoJsonMultiPoint: + return "MultiPoint"; + case GeoJsonObjectType.GeoJsonLineString: + return "LineString"; + case GeoJsonObjectType.GeoJsonMultiLineString: + return "MultiLineString"; + case GeoJsonObjectType.GeoJsonPolygon: + return "Polygon"; + case GeoJsonObjectType.GeoJsonMultiPolygon: + return "MultiPolygon"; + case GeoJsonObjectType.GeoJsonGeometryCollection: + return "GeometryCollection"; + case GeoJsonObjectType.GeoJsonFeature: + return "Feature"; + case GeoJsonObjectType.GeoJsonFeatureCollection: + return "FeatureCollection"; + } + return null; + } + + internal static GeoJsonObjectType? ParseGeoJsonObjectType(this string value) + { + switch( value ) + { + case "Point": + return GeoJsonObjectType.GeoJsonPoint; + case "MultiPoint": + return GeoJsonObjectType.GeoJsonMultiPoint; + case "LineString": + return GeoJsonObjectType.GeoJsonLineString; + case "MultiLineString": + return GeoJsonObjectType.GeoJsonMultiLineString; + case "Polygon": + return GeoJsonObjectType.GeoJsonPolygon; + case "MultiPolygon": + return GeoJsonObjectType.GeoJsonMultiPolygon; + case "GeometryCollection": + return GeoJsonObjectType.GeoJsonGeometryCollection; + case "Feature": + return GeoJsonObjectType.GeoJsonFeature; + case "FeatureCollection": + return GeoJsonObjectType.GeoJsonFeatureCollection; + } + return null; + } + } +} diff --git a/sdk/maps/Azure.Maps.Weather/src/Generated/Models/GeoJsonPoint.cs b/sdk/maps/Azure.Maps.Weather/src/Generated/Models/GeoJsonPoint.cs new file mode 100644 index 000000000000..3ce535774941 --- /dev/null +++ b/sdk/maps/Azure.Maps.Weather/src/Generated/Models/GeoJsonPoint.cs @@ -0,0 +1,66 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Azure.Maps.Weather.Models +{ + using Microsoft.Rest; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// A valid `GeoJSON Point` geometry type. Please refer to [RFC + /// 7946](https://tools.ietf.org/html/rfc7946#section-3.1.2) for details. + /// + public partial class GeoJsonPoint + { + /// + /// Initializes a new instance of the GeoJsonPoint class. + /// + public GeoJsonPoint() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the GeoJsonPoint class. + /// + public GeoJsonPoint(IList coordinates) + { + Coordinates = coordinates; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// + [JsonProperty(PropertyName = "coordinates")] + public IList Coordinates { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (Coordinates == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "Coordinates"); + } + } + } +} diff --git a/sdk/maps/Azure.Maps.Weather/src/Generated/Models/GeoJsonPointData.cs b/sdk/maps/Azure.Maps.Weather/src/Generated/Models/GeoJsonPointData.cs new file mode 100644 index 000000000000..47b415b94ff5 --- /dev/null +++ b/sdk/maps/Azure.Maps.Weather/src/Generated/Models/GeoJsonPointData.cs @@ -0,0 +1,65 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Azure.Maps.Weather.Models +{ + using Microsoft.Rest; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// Data contained by a `GeoJson Point`. + /// + public partial class GeoJsonPointData + { + /// + /// Initializes a new instance of the GeoJsonPointData class. + /// + public GeoJsonPointData() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the GeoJsonPointData class. + /// + public GeoJsonPointData(IList coordinates) + { + Coordinates = coordinates; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// + [JsonProperty(PropertyName = "coordinates")] + public IList Coordinates { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (Coordinates == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "Coordinates"); + } + } + } +} diff --git a/sdk/maps/Azure.Maps.Weather/src/Generated/Models/GeoJsonPolygon.cs b/sdk/maps/Azure.Maps.Weather/src/Generated/Models/GeoJsonPolygon.cs new file mode 100644 index 000000000000..27141d59ba20 --- /dev/null +++ b/sdk/maps/Azure.Maps.Weather/src/Generated/Models/GeoJsonPolygon.cs @@ -0,0 +1,69 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Azure.Maps.Weather.Models +{ + using Microsoft.Rest; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// A valid `GeoJSON Polygon` geometry type. Please refer to [RFC + /// 7946](https://tools.ietf.org/html/rfc7946#section-3.1.6) for details. + /// + public partial class GeoJsonPolygon + { + /// + /// Initializes a new instance of the GeoJsonPolygon class. + /// + public GeoJsonPolygon() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the GeoJsonPolygon class. + /// + /// Coordinates for the `GeoJson Polygon` + /// geometry type. + public GeoJsonPolygon(IList>> coordinates) + { + Coordinates = coordinates; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets coordinates for the `GeoJson Polygon` geometry type. + /// + [JsonProperty(PropertyName = "coordinates")] + public IList>> Coordinates { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (Coordinates == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "Coordinates"); + } + } + } +} diff --git a/sdk/maps/Azure.Maps.Weather/src/Generated/Models/GeoJsonPolygonData.cs b/sdk/maps/Azure.Maps.Weather/src/Generated/Models/GeoJsonPolygonData.cs new file mode 100644 index 000000000000..54a31b9a4a92 --- /dev/null +++ b/sdk/maps/Azure.Maps.Weather/src/Generated/Models/GeoJsonPolygonData.cs @@ -0,0 +1,65 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Azure.Maps.Weather.Models +{ + using Microsoft.Rest; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + public partial class GeoJsonPolygonData + { + /// + /// Initializes a new instance of the GeoJsonPolygonData class. + /// + public GeoJsonPolygonData() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the GeoJsonPolygonData class. + /// + /// Coordinates for the `GeoJson Polygon` + /// geometry type. + public GeoJsonPolygonData(IList>> coordinates) + { + Coordinates = coordinates; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets coordinates for the `GeoJson Polygon` geometry type. + /// + [JsonProperty(PropertyName = "coordinates")] + public IList>> Coordinates { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (Coordinates == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "Coordinates"); + } + } + } +} diff --git a/sdk/maps/Azure.Maps.Weather/src/Generated/Models/HazardDetail.cs b/sdk/maps/Azure.Maps.Weather/src/Generated/Models/HazardDetail.cs new file mode 100644 index 000000000000..8f131690bf32 --- /dev/null +++ b/sdk/maps/Azure.Maps.Weather/src/Generated/Models/HazardDetail.cs @@ -0,0 +1,77 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Azure.Maps.Weather.Models +{ + using Newtonsoft.Json; + using System.Linq; + + public partial class HazardDetail + { + /// + /// Initializes a new instance of the HazardDetail class. + /// + public HazardDetail() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the HazardDetail class. + /// + /// A unique identifier (non-displayable) for + /// each type of hazard: LightRain, ModerateRain, HeavyRain, LightMix, + /// ModerateMix, HeavyMix, LightSnow, ModerateSnow, HeavySnow, + /// LightIce, ModerateIce, HeavyIce, Hail, LargeHail, SunGlare, + /// SunGlareHigh, Lightning, SevereLightning, WindModerate, WindHigh, + /// WindExtreme, FloodWarning, FlashFloodWarning, TornadoWarning, + /// TsunamiWarning, SevereThunderstormWarning. + /// A displayable short phrase + /// describing the forecasted conditions and precipitation + /// intensity/type. + public HazardDetail(int? hazardIndex = default(int?), string hazardCode = default(string), string shortDescription = default(string)) + { + HazardIndex = hazardIndex; + HazardCode = hazardCode; + ShortDescription = shortDescription; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// + [JsonProperty(PropertyName = "hazardIndex")] + public int? HazardIndex { get; set; } + + /// + /// Gets or sets a unique identifier (non-displayable) for each type of + /// hazard: LightRain, ModerateRain, HeavyRain, LightMix, ModerateMix, + /// HeavyMix, LightSnow, ModerateSnow, HeavySnow, LightIce, + /// ModerateIce, HeavyIce, Hail, LargeHail, SunGlare, SunGlareHigh, + /// Lightning, SevereLightning, WindModerate, WindHigh, WindExtreme, + /// FloodWarning, FlashFloodWarning, TornadoWarning, TsunamiWarning, + /// SevereThunderstormWarning. + /// + [JsonProperty(PropertyName = "hazardCode")] + public string HazardCode { get; set; } + + /// + /// Gets or sets a displayable short phrase describing the forecasted + /// conditions and precipitation intensity/type. + /// + [JsonProperty(PropertyName = "shortPhrase")] + public string ShortDescription { get; set; } + + } +} diff --git a/sdk/maps/Azure.Maps.Weather/src/Generated/Models/HourlyForecast.cs b/sdk/maps/Azure.Maps.Weather/src/Generated/Models/HourlyForecast.cs new file mode 100644 index 000000000000..0b8ae10c78f0 --- /dev/null +++ b/sdk/maps/Azure.Maps.Weather/src/Generated/Models/HourlyForecast.cs @@ -0,0 +1,281 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Azure.Maps.Weather.Models +{ + using Newtonsoft.Json; + using System.Linq; + + public partial class HourlyForecast + { + /// + /// Initializes a new instance of the HourlyForecast class. + /// + public HourlyForecast() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the HourlyForecast class. + /// + /// Date and time of the forecast in ISO 8601 + /// format, for example, 2019-10-27T19:39:57-08:00. + /// Phrase description of the weather + /// icon. + /// Indicates the presence or absence of + /// precipitation. True indicates the presence of precipitation, false + /// indicates the absence of precipitation. + /// Specifies whether or not it is daylight. + /// True indicates day light. + /// Temperature being returned. + /// RealFeel™ Temperature being + /// returned. Describes what the temperature really feels like in the + /// shade. + /// The temperature to which air may + /// be cooled by evaporating water into it at constant pressure until + /// it reaches saturation. + /// The dewpoint temperature in specified unit. + /// The dewpoint temperature is the temperature that the air must be + /// cooled to in order to reach saturation. + /// Wind details being returned including speed and + /// direction. + /// Wind gust. Wind gust is a sudden, brief + /// increase in speed of the wind. + /// Relative humidity is the amount of + /// water vapor present in air expressed as a percentage of the amount + /// needed for saturation at the same temperature. + /// Visibility in specified unit. A measure of + /// the distance at which an object or light can be clearly + /// discerned. + /// Cloud ceiling in specified unit. The + /// ceiling is a measurement of the height of the base of the lowest + /// clouds. + /// Phrase associated with the + /// `uvIndex`. + /// Percent representing the + /// probability of precipitation. For example, '20'. + /// Percent representing the probability + /// of rain. For example, '50'. + /// Percent representing the probability + /// of snow. For example, '50'. + /// Percent representing the probability + /// of snow. For example, '5'. + /// Total liquid equivalent of precipitation + /// during the forecast period. + /// Rain + /// Snow + /// Ice + /// Percent representing cloud cover. + public HourlyForecast(System.DateTime? timestamp = default(System.DateTime?), int? iconCode = default(int?), string iconPhrase = default(string), bool? hasPrecipitation = default(bool?), bool? isDaylight = default(bool?), WeatherUnit temperature = default(WeatherUnit), WeatherUnit realFeelTemperature = default(WeatherUnit), WeatherUnit wetBulbTemperature = default(WeatherUnit), WeatherUnit dewPoint = default(WeatherUnit), WindDetails wind = default(WindDetails), WindDetails windGust = default(WindDetails), int? relativeHumidity = default(int?), WeatherUnit visibility = default(WeatherUnit), WeatherUnit cloudCeiling = default(WeatherUnit), int? uvIndex = default(int?), string uvIndexDescription = default(string), int? precipitationProbability = default(int?), int? rainProbability = default(int?), int? snowProbability = default(int?), int? iceProbability = default(int?), WeatherUnit totalLiquid = default(WeatherUnit), WeatherUnit rain = default(WeatherUnit), WeatherUnit snow = default(WeatherUnit), WeatherUnit ice = default(WeatherUnit), int? cloudCover = default(int?)) + { + Timestamp = timestamp; + IconCode = iconCode; + IconPhrase = iconPhrase; + HasPrecipitation = hasPrecipitation; + IsDaylight = isDaylight; + Temperature = temperature; + RealFeelTemperature = realFeelTemperature; + WetBulbTemperature = wetBulbTemperature; + DewPoint = dewPoint; + Wind = wind; + WindGust = windGust; + RelativeHumidity = relativeHumidity; + Visibility = visibility; + CloudCeiling = cloudCeiling; + UvIndex = uvIndex; + UvIndexDescription = uvIndexDescription; + PrecipitationProbability = precipitationProbability; + RainProbability = rainProbability; + SnowProbability = snowProbability; + IceProbability = iceProbability; + TotalLiquid = totalLiquid; + Rain = rain; + Snow = snow; + Ice = ice; + CloudCover = cloudCover; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets date and time of the forecast in ISO 8601 format, for + /// example, 2019-10-27T19:39:57-08:00. + /// + [JsonProperty(PropertyName = "date")] + public System.DateTime? Timestamp { get; set; } + + /// + /// + [JsonProperty(PropertyName = "iconCode")] + public int? IconCode { get; set; } + + /// + /// Gets or sets phrase description of the weather icon. + /// + [JsonProperty(PropertyName = "iconPhrase")] + public string IconPhrase { get; set; } + + /// + /// Gets or sets indicates the presence or absence of precipitation. + /// True indicates the presence of precipitation, false indicates the + /// absence of precipitation. + /// + [JsonProperty(PropertyName = "hasPrecipitation")] + public bool? HasPrecipitation { get; set; } + + /// + /// Gets or sets specifies whether or not it is daylight. True + /// indicates day light. + /// + [JsonProperty(PropertyName = "isDaylight")] + public bool? IsDaylight { get; set; } + + /// + /// Gets or sets temperature being returned. + /// + [JsonProperty(PropertyName = "temperature")] + public WeatherUnit Temperature { get; set; } + + /// + /// Gets or sets realFeel™ Temperature being returned. Describes what + /// the temperature really feels like in the shade. + /// + [JsonProperty(PropertyName = "realFeelTemperature")] + public WeatherUnit RealFeelTemperature { get; set; } + + /// + /// Gets or sets the temperature to which air may be cooled by + /// evaporating water into it at constant pressure until it reaches + /// saturation. + /// + [JsonProperty(PropertyName = "wetBulbTemperature")] + public WeatherUnit WetBulbTemperature { get; set; } + + /// + /// Gets or sets the dewpoint temperature in specified unit. The + /// dewpoint temperature is the temperature that the air must be cooled + /// to in order to reach saturation. + /// + [JsonProperty(PropertyName = "dewPoint")] + public WeatherUnit DewPoint { get; set; } + + /// + /// Gets or sets wind details being returned including speed and + /// direction. + /// + [JsonProperty(PropertyName = "wind")] + public WindDetails Wind { get; set; } + + /// + /// Gets or sets wind gust. Wind gust is a sudden, brief increase in + /// speed of the wind. + /// + [JsonProperty(PropertyName = "windGust")] + public WindDetails WindGust { get; set; } + + /// + /// Gets or sets relative humidity is the amount of water vapor present + /// in air expressed as a percentage of the amount needed for + /// saturation at the same temperature. + /// + [JsonProperty(PropertyName = "relativeHumidity")] + public int? RelativeHumidity { get; set; } + + /// + /// Gets or sets visibility in specified unit. A measure of the + /// distance at which an object or light can be clearly discerned. + /// + [JsonProperty(PropertyName = "visibility")] + public WeatherUnit Visibility { get; set; } + + /// + /// Gets or sets cloud ceiling in specified unit. The ceiling is a + /// measurement of the height of the base of the lowest clouds. + /// + [JsonProperty(PropertyName = "ceiling")] + public WeatherUnit CloudCeiling { get; set; } + + /// + /// + [JsonProperty(PropertyName = "uvIndex")] + public int? UvIndex { get; set; } + + /// + /// Gets or sets phrase associated with the `uvIndex`. + /// + [JsonProperty(PropertyName = "uvIndexPhrase")] + public string UvIndexDescription { get; set; } + + /// + /// Gets or sets percent representing the probability of precipitation. + /// For example, '20'. + /// + [JsonProperty(PropertyName = "precipitationProbability")] + public int? PrecipitationProbability { get; set; } + + /// + /// Gets or sets percent representing the probability of rain. For + /// example, '50'. + /// + [JsonProperty(PropertyName = "rainProbability")] + public int? RainProbability { get; set; } + + /// + /// Gets or sets percent representing the probability of snow. For + /// example, '50'. + /// + [JsonProperty(PropertyName = "snowProbability")] + public int? SnowProbability { get; set; } + + /// + /// Gets or sets percent representing the probability of snow. For + /// example, '5'. + /// + [JsonProperty(PropertyName = "iceProbability")] + public int? IceProbability { get; set; } + + /// + /// Gets or sets total liquid equivalent of precipitation during the + /// forecast period. + /// + [JsonProperty(PropertyName = "totalLiquid")] + public WeatherUnit TotalLiquid { get; set; } + + /// + /// Gets or sets rain + /// + [JsonProperty(PropertyName = "rain")] + public WeatherUnit Rain { get; set; } + + /// + /// Gets or sets snow + /// + [JsonProperty(PropertyName = "snow")] + public WeatherUnit Snow { get; set; } + + /// + /// Gets or sets ice + /// + [JsonProperty(PropertyName = "ice")] + public WeatherUnit Ice { get; set; } + + /// + /// Gets or sets percent representing cloud cover. + /// + [JsonProperty(PropertyName = "cloudCover")] + public int? CloudCover { get; set; } + + } +} diff --git a/sdk/maps/Azure.Maps.Weather/src/Generated/Models/HourlyForecastResult.cs b/sdk/maps/Azure.Maps.Weather/src/Generated/Models/HourlyForecastResult.cs new file mode 100644 index 000000000000..22842bf3da12 --- /dev/null +++ b/sdk/maps/Azure.Maps.Weather/src/Generated/Models/HourlyForecastResult.cs @@ -0,0 +1,51 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Azure.Maps.Weather.Models +{ + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + public partial class HourlyForecastResult + { + /// + /// Initializes a new instance of the HourlyForecastResult class. + /// + public HourlyForecastResult() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the HourlyForecastResult class. + /// + /// Forecast data for each returned + /// hour. + public HourlyForecastResult(IList forecasts = default(IList)) + { + Forecasts = forecasts; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets forecast data for each returned hour. + /// + [JsonProperty(PropertyName = "forecasts")] + public IList Forecasts { get; private set; } + + } +} diff --git a/sdk/maps/Azure.Maps.Weather/src/Generated/Models/IntervalSummary.cs b/sdk/maps/Azure.Maps.Weather/src/Generated/Models/IntervalSummary.cs new file mode 100644 index 000000000000..6dea5cb616e1 --- /dev/null +++ b/sdk/maps/Azure.Maps.Weather/src/Generated/Models/IntervalSummary.cs @@ -0,0 +1,102 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Azure.Maps.Weather.Models +{ + using Newtonsoft.Json; + using System.Linq; + + public partial class IntervalSummary + { + /// + /// Initializes a new instance of the IntervalSummary class. + /// + public IntervalSummary() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the IntervalSummary class. + /// + /// The first minute to which the summary + /// applies. + /// The last minute to which the summary + /// applies. + /// The number of minutes for which the + /// summary applies. + /// Short summary phrase. Phrase length + /// is approximately 25 characters. + /// Brief summary phrase. Phrase length + /// is approximately 60 characters. + /// Long summary phrase. Phrase length is 60+ + /// characters. + public IntervalSummary(int? startMinute = default(int?), int? endMinute = default(int?), int? totalMinutes = default(int?), string shortDescription = default(string), string briefDescription = default(string), string longPhrase = default(string), int? iconCode = default(int?)) + { + StartMinute = startMinute; + EndMinute = endMinute; + TotalMinutes = totalMinutes; + ShortDescription = shortDescription; + BriefDescription = briefDescription; + LongPhrase = longPhrase; + IconCode = iconCode; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the first minute to which the summary applies. + /// + [JsonProperty(PropertyName = "startMinute")] + public int? StartMinute { get; set; } + + /// + /// Gets or sets the last minute to which the summary applies. + /// + [JsonProperty(PropertyName = "endMinute")] + public int? EndMinute { get; set; } + + /// + /// Gets or sets the number of minutes for which the summary applies. + /// + [JsonProperty(PropertyName = "totalMinutes")] + public int? TotalMinutes { get; set; } + + /// + /// Gets or sets short summary phrase. Phrase length is approximately + /// 25 characters. + /// + [JsonProperty(PropertyName = "shortPhrase")] + public string ShortDescription { get; set; } + + /// + /// Gets or sets brief summary phrase. Phrase length is approximately + /// 60 characters. + /// + [JsonProperty(PropertyName = "briefPhrase")] + public string BriefDescription { get; set; } + + /// + /// Gets or sets long summary phrase. Phrase length is 60+ characters. + /// + [JsonProperty(PropertyName = "longPhrase")] + public string LongPhrase { get; set; } + + /// + /// + [JsonProperty(PropertyName = "iconCode")] + public int? IconCode { get; set; } + + } +} diff --git a/sdk/maps/Azure.Maps.Weather/src/Generated/Models/LatLongPair.cs b/sdk/maps/Azure.Maps.Weather/src/Generated/Models/LatLongPair.cs new file mode 100644 index 000000000000..e9c1850fedc3 --- /dev/null +++ b/sdk/maps/Azure.Maps.Weather/src/Generated/Models/LatLongPair.cs @@ -0,0 +1,59 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Azure.Maps.Weather.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// A location represented as a latitude and longitude. + /// + public partial class LatLongPair + { + /// + /// Initializes a new instance of the LatLongPair class. + /// + public LatLongPair() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the LatLongPair class. + /// + /// Latitude property + /// Longitude property + public LatLongPair(double? latitude = default(double?), double? longitude = default(double?)) + { + Latitude = latitude; + Longitude = longitude; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets latitude property + /// + [JsonProperty(PropertyName = "latitude")] + public double? Latitude { get; set; } + + /// + /// Gets or sets longitude property + /// + [JsonProperty(PropertyName = "longitude")] + public double? Longitude { get; set; } + + } +} diff --git a/sdk/maps/Azure.Maps.Weather/src/Generated/Models/LatestStatus.cs b/sdk/maps/Azure.Maps.Weather/src/Generated/Models/LatestStatus.cs new file mode 100644 index 000000000000..ff4c9a365525 --- /dev/null +++ b/sdk/maps/Azure.Maps.Weather/src/Generated/Models/LatestStatus.cs @@ -0,0 +1,67 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Azure.Maps.Weather.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// The latest status on the alert in the current area. + /// + public partial class LatestStatus + { + /// + /// Initializes a new instance of the LatestStatus class. + /// + public LatestStatus() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the LatestStatus class. + /// + /// The latest status keyword for the alert, in + /// the specified language. By default, returned in English + /// (en-US). + /// Latest status keyword for the alert, in + /// English (en-US). Possible values include: 'New', 'Extend', + /// 'Cancel', 'Correct', 'Expire', 'Upgrade', 'Continue', + /// 'Update' + public LatestStatus(string localized = default(string), string english = default(string)) + { + Localized = localized; + English = english; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the latest status keyword for the alert, in the + /// specified language. By default, returned in English (en-US). + /// + [JsonProperty(PropertyName = "localized")] + public string Localized { get; set; } + + /// + /// Gets or sets latest status keyword for the alert, in English + /// (en-US). Possible values include: 'New', 'Extend', 'Cancel', + /// 'Correct', 'Expire', 'Upgrade', 'Continue', 'Update' + /// + [JsonProperty(PropertyName = "english")] + public string English { get; set; } + + } +} diff --git a/sdk/maps/Azure.Maps.Weather/src/Generated/Models/LatestStatusKeyword.cs b/sdk/maps/Azure.Maps.Weather/src/Generated/Models/LatestStatusKeyword.cs new file mode 100644 index 000000000000..cc61a51134e2 --- /dev/null +++ b/sdk/maps/Azure.Maps.Weather/src/Generated/Models/LatestStatusKeyword.cs @@ -0,0 +1,58 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Azure.Maps.Weather.Models +{ + + /// + /// Defines values for LatestStatusKeyword. + /// + public static class LatestStatusKeyword + { + /// + /// "New" - the status of an alert upon initial issuance. + /// + public const string New = "New"; + /// + /// "Extend" - the alert has been extended in time, in area, or both + /// since its initial issuance. + /// + public const string Extend = "Extend"; + /// + /// "Cancel" - the alert has been canceled prior to its original + /// expiration time. + /// + public const string Cancel = "Cancel"; + /// + /// "Correct" - the alert has been modified to correct a previous + /// error. + /// + public const string Correct = "Correct"; + /// + /// "Expire" - the alert has expired and is no longer active. + /// + public const string Expire = "Expire"; + /// + /// "Upgrade" - the alert has been upgraded to a higher class or + /// category since its initial issuance. + /// + public const string Upgrade = "Upgrade"; + /// + /// "Continue" - the alert has been updated since its initial issuance, + /// but no changes were made to `alertDetails`, `startTime`, `endTime`, + /// or `class`. + /// + public const string Continue = "Continue"; + /// + /// "Update" - the alert has been updated since its initial issuance. + /// + public const string Update = "Update"; + } +} diff --git a/sdk/maps/Azure.Maps.Weather/src/Generated/Models/LocalSource.cs b/sdk/maps/Azure.Maps.Weather/src/Generated/Models/LocalSource.cs new file mode 100644 index 000000000000..9ee5e671ef14 --- /dev/null +++ b/sdk/maps/Azure.Maps.Weather/src/Generated/Models/LocalSource.cs @@ -0,0 +1,79 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Azure.Maps.Weather.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Local weather data provider information. + /// + public partial class LocalSource + { + /// + /// Initializes a new instance of the LocalSource class. + /// + public LocalSource() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the LocalSource class. + /// + /// Numeric identifier, unique to the local data + /// provider. + /// Name of the local data provider. Name is + /// displayed in the language specified by language code in URL, if + /// available. Otherwise, Name is displayed in English or the language + /// in which the name was provided. + /// Weather code provided by the local data + /// provider. This weather code allows the forecast to be matched to + /// icons provided by the local data provider instead of Azure Maps + /// icons. + public LocalSource(int? id = default(int?), string name = default(string), string weatherCode = default(string)) + { + Id = id; + Name = name; + WeatherCode = weatherCode; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets numeric identifier, unique to the local data provider. + /// + [JsonProperty(PropertyName = "id")] + public int? Id { get; set; } + + /// + /// Gets or sets name of the local data provider. Name is displayed in + /// the language specified by language code in URL, if available. + /// Otherwise, Name is displayed in English or the language in which + /// the name was provided. + /// + [JsonProperty(PropertyName = "name")] + public string Name { get; set; } + + /// + /// Gets or sets weather code provided by the local data provider. This + /// weather code allows the forecast to be matched to icons provided by + /// the local data provider instead of Azure Maps icons. + /// + [JsonProperty(PropertyName = "weatherCode")] + public string WeatherCode { get; set; } + + } +} diff --git a/sdk/maps/Azure.Maps.Weather/src/Generated/Models/MinuteForecastResult.cs b/sdk/maps/Azure.Maps.Weather/src/Generated/Models/MinuteForecastResult.cs new file mode 100644 index 000000000000..58be3043b5c7 --- /dev/null +++ b/sdk/maps/Azure.Maps.Weather/src/Generated/Models/MinuteForecastResult.cs @@ -0,0 +1,69 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Azure.Maps.Weather.Models +{ + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + public partial class MinuteForecastResult + { + /// + /// Initializes a new instance of the MinuteForecastResult class. + /// + public MinuteForecastResult() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the MinuteForecastResult class. + /// + /// Summary information for each + /// interval in the forecast. The Summaries breaks down each potential + /// interval where precipitation starts and stops. + /// Forecast data for each interval in the + /// forecast. + public MinuteForecastResult(MinuteForecastSummary summary = default(MinuteForecastSummary), IList intervalSummaries = default(IList), IList intervals = default(IList)) + { + Summary = summary; + IntervalSummaries = intervalSummaries; + Intervals = intervals; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// + [JsonProperty(PropertyName = "summary")] + public MinuteForecastSummary Summary { get; private set; } + + /// + /// Gets summary information for each interval in the forecast. The + /// Summaries breaks down each potential interval where precipitation + /// starts and stops. + /// + [JsonProperty(PropertyName = "intervalSummaries")] + public IList IntervalSummaries { get; private set; } + + /// + /// Gets forecast data for each interval in the forecast. + /// + [JsonProperty(PropertyName = "intervals")] + public IList Intervals { get; private set; } + + } +} diff --git a/sdk/maps/Azure.Maps.Weather/src/Generated/Models/MinuteForecastSummary.cs b/sdk/maps/Azure.Maps.Weather/src/Generated/Models/MinuteForecastSummary.cs new file mode 100644 index 000000000000..dbd579e26e50 --- /dev/null +++ b/sdk/maps/Azure.Maps.Weather/src/Generated/Models/MinuteForecastSummary.cs @@ -0,0 +1,89 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Azure.Maps.Weather.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Phrase summaries for the entire forecast period. + /// + public partial class MinuteForecastSummary + { + /// + /// Initializes a new instance of the MinuteForecastSummary class. + /// + public MinuteForecastSummary() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the MinuteForecastSummary class. + /// + /// Summary phrase for the next 60 minutes. + /// Phrase length is approximately 60 characters. + /// Short summary phrase for the next + /// 120 minutes. Phrase length is approximately 25 characters. + /// Summary phrase for the next 120 + /// minutes. Phrase length is approximately 60 characters. + /// Long summary phrase for the next 120 + /// minutes. Phrase length is 60+ characters. + public MinuteForecastSummary(string briefPhrase60 = default(string), string shortDescription = default(string), string briefDescription = default(string), string longPhrase = default(string), int? iconCode = default(int?)) + { + BriefPhrase60 = briefPhrase60; + ShortDescription = shortDescription; + BriefDescription = briefDescription; + LongPhrase = longPhrase; + IconCode = iconCode; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets summary phrase for the next 60 minutes. Phrase length + /// is approximately 60 characters. + /// + [JsonProperty(PropertyName = "briefPhrase60")] + public string BriefPhrase60 { get; set; } + + /// + /// Gets or sets short summary phrase for the next 120 minutes. Phrase + /// length is approximately 25 characters. + /// + [JsonProperty(PropertyName = "shortPhrase")] + public string ShortDescription { get; set; } + + /// + /// Gets or sets summary phrase for the next 120 minutes. Phrase length + /// is approximately 60 characters. + /// + [JsonProperty(PropertyName = "briefPhrase")] + public string BriefDescription { get; set; } + + /// + /// Gets or sets long summary phrase for the next 120 minutes. Phrase + /// length is 60+ characters. + /// + [JsonProperty(PropertyName = "longPhrase")] + public string LongPhrase { get; set; } + + /// + /// + [JsonProperty(PropertyName = "iconCode")] + public int? IconCode { get; set; } + + } +} diff --git a/sdk/maps/Azure.Maps.Weather/src/Generated/Models/PastHoursTemperature.cs b/sdk/maps/Azure.Maps.Weather/src/Generated/Models/PastHoursTemperature.cs new file mode 100644 index 000000000000..edc9996f5068 --- /dev/null +++ b/sdk/maps/Azure.Maps.Weather/src/Generated/Models/PastHoursTemperature.cs @@ -0,0 +1,59 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Azure.Maps.Weather.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Summary of temperature fluctuations over the number of past hours. + /// + public partial class PastHoursTemperature + { + /// + /// Initializes a new instance of the PastHoursTemperature class. + /// + public PastHoursTemperature() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the PastHoursTemperature class. + /// + /// minimum + /// maximum + public PastHoursTemperature(WeatherUnit minimum = default(WeatherUnit), WeatherUnit maximum = default(WeatherUnit)) + { + Minimum = minimum; + Maximum = maximum; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets minimum + /// + [JsonProperty(PropertyName = "minimum")] + public WeatherUnit Minimum { get; set; } + + /// + /// Gets or sets maximum + /// + [JsonProperty(PropertyName = "maximum")] + public WeatherUnit Maximum { get; set; } + + } +} diff --git a/sdk/maps/Azure.Maps.Weather/src/Generated/Models/Pollutant.cs b/sdk/maps/Azure.Maps.Weather/src/Generated/Models/Pollutant.cs new file mode 100644 index 000000000000..0f144ac29c21 --- /dev/null +++ b/sdk/maps/Azure.Maps.Weather/src/Generated/Models/Pollutant.cs @@ -0,0 +1,100 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Azure.Maps.Weather.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Detailed information about an individual pollutant. Not returned if + /// `pollutants`=false. + /// + public partial class Pollutant + { + /// + /// Initializes a new instance of the Pollutant class. + /// + public Pollutant() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the Pollutant class. + /// + /// Type of pollutant. Please note that more may be + /// added at any time. Possible values include: 'CO', 'NO2', 'O3', + /// 'PM2.5', 'PM10', 'SO2' + /// The name of the pollutant in English. + /// Air quality rating on a scale set by local + /// regulating bodies. Scales can vary widely based on location. See + /// [Wikipedia](https://en.wikipedia.org/wiki/Air_quality_index) for + /// more information. + /// Internationally normalized air quality + /// rating on a scale from 0 to 300 and up, with higher numbers + /// representing worse air quality. + /// An object containing the number of + /// pollutant particles per volume of air. + public Pollutant(string type = default(string), string name = default(string), double? index = default(double?), double? globalIndex = default(double?), WeatherUnit concentration = default(WeatherUnit)) + { + Type = type; + Name = name; + Index = index; + GlobalIndex = globalIndex; + Concentration = concentration; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets type of pollutant. Please note that more may be added + /// at any time. Possible values include: 'CO', 'NO2', 'O3', 'PM2.5', + /// 'PM10', 'SO2' + /// + [JsonProperty(PropertyName = "type")] + public string Type { get; set; } + + /// + /// Gets or sets the name of the pollutant in English. + /// + [JsonProperty(PropertyName = "name")] + public string Name { get; set; } + + /// + /// Gets or sets air quality rating on a scale set by local regulating + /// bodies. Scales can vary widely based on location. See + /// [Wikipedia](https://en.wikipedia.org/wiki/Air_quality_index) for + /// more information. + /// + [JsonProperty(PropertyName = "index")] + public double? Index { get; set; } + + /// + /// Gets or sets internationally normalized air quality rating on a + /// scale from 0 to 300 and up, with higher numbers representing worse + /// air quality. + /// + [JsonProperty(PropertyName = "globalIndex")] + public double? GlobalIndex { get; set; } + + /// + /// Gets or sets an object containing the number of pollutant particles + /// per volume of air. + /// + [JsonProperty(PropertyName = "concentration")] + public WeatherUnit Concentration { get; set; } + + } +} diff --git a/sdk/maps/Azure.Maps.Weather/src/Generated/Models/PollutantType.cs b/sdk/maps/Azure.Maps.Weather/src/Generated/Models/PollutantType.cs new file mode 100644 index 000000000000..a3de63381591 --- /dev/null +++ b/sdk/maps/Azure.Maps.Weather/src/Generated/Models/PollutantType.cs @@ -0,0 +1,44 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Azure.Maps.Weather.Models +{ + + /// + /// Defines values for PollutantType. + /// + public static class PollutantType + { + /// + /// Carbon monoxide ("CO") + /// + public const string CO = "CO"; + /// + /// Nitrogen dioxide ("NO2") + /// + public const string NO2 = "NO2"; + /// + /// Ozone ("O3") + /// + public const string O3 = "O3"; + /// + /// Particulate matter 2.5 ("PM2.5") + /// + public const string PM25 = "PM2.5"; + /// + /// Particulate matter 10 ("PM10") + /// + public const string PM10 = "PM10"; + /// + /// Sulfur dioxide ("SO2") + /// + public const string SO2 = "SO2"; + } +} diff --git a/sdk/maps/Azure.Maps.Weather/src/Generated/Models/PrecipitationSummary.cs b/sdk/maps/Azure.Maps.Weather/src/Generated/Models/PrecipitationSummary.cs new file mode 100644 index 000000000000..3daf63f3a5bf --- /dev/null +++ b/sdk/maps/Azure.Maps.Weather/src/Generated/Models/PrecipitationSummary.cs @@ -0,0 +1,112 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Azure.Maps.Weather.Models +{ + using Newtonsoft.Json; + using System.Linq; + + public partial class PrecipitationSummary + { + /// + /// Initializes a new instance of the PrecipitationSummary class. + /// + public PrecipitationSummary() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the PrecipitationSummary class. + /// + /// The amount of precipitation (liquid + /// equivalent) that has fallen in the past hour. + /// The amount of precipitation (liquid + /// equivalent) that has fallen in the past three hours. + /// The amount of precipitation (liquid + /// equivalent) that has fallen in the past six hours. Contains Metric + /// and Imperial Values. + /// The amount of precipitation (liquid + /// equivalent) that has fallen in the past nine hours. + /// The amount of precipitation (liquid + /// equivalent) that has fallen in the past 12 hours. + /// The amount of precipitation (liquid + /// equivalent) that has fallen in the past 18 hours. + /// The amount of precipitation + /// (liquid equivalent) that has fallen in the past 24 hours. + public PrecipitationSummary(WeatherUnit pastHour = default(WeatherUnit), WeatherUnit pastThreeHours = default(WeatherUnit), WeatherUnit pastSixHours = default(WeatherUnit), WeatherUnit pastNineHours = default(WeatherUnit), WeatherUnit pastTwelveHours = default(WeatherUnit), WeatherUnit pastEighteenHours = default(WeatherUnit), WeatherUnit pastTwentyFourHours = default(WeatherUnit)) + { + PastHour = pastHour; + PastThreeHours = pastThreeHours; + PastSixHours = pastSixHours; + PastNineHours = pastNineHours; + PastTwelveHours = pastTwelveHours; + PastEighteenHours = pastEighteenHours; + PastTwentyFourHours = pastTwentyFourHours; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the amount of precipitation (liquid equivalent) that + /// has fallen in the past hour. + /// + [JsonProperty(PropertyName = "pastHour")] + public WeatherUnit PastHour { get; set; } + + /// + /// Gets or sets the amount of precipitation (liquid equivalent) that + /// has fallen in the past three hours. + /// + [JsonProperty(PropertyName = "pastThreeHours")] + public WeatherUnit PastThreeHours { get; set; } + + /// + /// Gets or sets the amount of precipitation (liquid equivalent) that + /// has fallen in the past six hours. Contains Metric and Imperial + /// Values. + /// + [JsonProperty(PropertyName = "pastSixHours")] + public WeatherUnit PastSixHours { get; set; } + + /// + /// Gets or sets the amount of precipitation (liquid equivalent) that + /// has fallen in the past nine hours. + /// + [JsonProperty(PropertyName = "pastNineHours")] + public WeatherUnit PastNineHours { get; set; } + + /// + /// Gets or sets the amount of precipitation (liquid equivalent) that + /// has fallen in the past 12 hours. + /// + [JsonProperty(PropertyName = "pastTwelveHours")] + public WeatherUnit PastTwelveHours { get; set; } + + /// + /// Gets or sets the amount of precipitation (liquid equivalent) that + /// has fallen in the past 18 hours. + /// + [JsonProperty(PropertyName = "pastEighteenHours")] + public WeatherUnit PastEighteenHours { get; set; } + + /// + /// Gets or sets the amount of precipitation (liquid equivalent) that + /// has fallen in the past 24 hours. + /// + [JsonProperty(PropertyName = "pastTwentyFourHours")] + public WeatherUnit PastTwentyFourHours { get; set; } + + } +} diff --git a/sdk/maps/Azure.Maps.Weather/src/Generated/Models/PrecipitationType.cs b/sdk/maps/Azure.Maps.Weather/src/Generated/Models/PrecipitationType.cs new file mode 100644 index 000000000000..f396c4e23b29 --- /dev/null +++ b/sdk/maps/Azure.Maps.Weather/src/Generated/Models/PrecipitationType.cs @@ -0,0 +1,36 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Azure.Maps.Weather.Models +{ + + /// + /// Defines values for PrecipitationType. + /// + public static class PrecipitationType + { + /// + /// Rain + /// + public const string Rain = "Rain"; + /// + /// Snow + /// + public const string Snow = "Snow"; + /// + /// Ice + /// + public const string Ice = "Ice"; + /// + /// Mix + /// + public const string Mix = "Mix"; + } +} diff --git a/sdk/maps/Azure.Maps.Weather/src/Generated/Models/PressureTendency.cs b/sdk/maps/Azure.Maps.Weather/src/Generated/Models/PressureTendency.cs new file mode 100644 index 000000000000..f3e8dd283530 --- /dev/null +++ b/sdk/maps/Azure.Maps.Weather/src/Generated/Models/PressureTendency.cs @@ -0,0 +1,60 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Azure.Maps.Weather.Models +{ + using Newtonsoft.Json; + using System.Linq; + + public partial class PressureTendency + { + /// + /// Initializes a new instance of the PressureTendency class. + /// + public PressureTendency() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the PressureTendency class. + /// + /// Description of the pressure tendency in + /// specified language + /// Pressure tendency code regardless of language. + /// One of F=Falling, S=Steady, R=Rising. + public PressureTendency(string description = default(string), string code = default(string)) + { + Description = description; + Code = code; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets description of the pressure tendency in specified + /// language + /// + [JsonProperty(PropertyName = "localizedDescription")] + public string Description { get; set; } + + /// + /// Gets or sets pressure tendency code regardless of language. One of + /// F=Falling, S=Steady, R=Rising. + /// + [JsonProperty(PropertyName = "code")] + public string Code { get; set; } + + } +} diff --git a/sdk/maps/Azure.Maps.Weather/src/Generated/Models/QuarterDayForecast.cs b/sdk/maps/Azure.Maps.Weather/src/Generated/Models/QuarterDayForecast.cs new file mode 100644 index 000000000000..23f121d1deb5 --- /dev/null +++ b/sdk/maps/Azure.Maps.Weather/src/Generated/Models/QuarterDayForecast.cs @@ -0,0 +1,259 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Azure.Maps.Weather.Models +{ + using Newtonsoft.Json; + using System.Linq; + + public partial class QuarterDayForecast + { + /// + /// Initializes a new instance of the QuarterDayForecast class. + /// + public QuarterDayForecast() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the QuarterDayForecast class. + /// + /// Date of the forecast as example, + /// 2019-10-27T00:00:00 + /// Date and time of the beginning of the + /// forecast quarter displayed in ISO 8601 format, for example, + /// 2019-10-27T19:39:57-08:00. + /// Quarter of the day. + /// Phrase description of the icon. Displayed + /// in specified language. For example, 'Sunny'. + /// Short summary phrase summary for + /// quarter. + /// Temperature values for the + /// quarter. + /// RealFeel™ Temperature values for + /// the quarter. + /// The dewpoint temperature in specified unit. + /// The dewpoint temperature is the temperature that the air must be + /// cooled to in order to reach saturation. + /// Relative humidity is the amount of + /// water vapor present in air expressed as a percentage of the amount + /// needed for saturation at the same temperature. + /// Wind details being returned including speed and + /// direction. + /// Wind gust. Wind gust is a sudden, brief + /// increase in speed of the wind. + /// Visibility in specified unit. A measure of + /// the distance at which an object or light can be clearly + /// discerned. + /// Percent representing cloud cover. + /// Indicates the presence or absence of + /// precipitation. True indicates the presence of precipitation, false + /// indicates the absence of precipitation. + /// Possible values include: 'Rain', + /// 'Snow', 'Ice', 'Mix' + /// Description of the + /// intensity. + /// Percent representing the + /// probability of precipitation. For example, '20'. + /// Percent representing the + /// probability of a thunderstorm. For example, '10'. + /// Total liquid equivalent of precipitation + /// during the forecast period. + /// Rain + /// Snow + /// Ice + public QuarterDayForecast(System.DateTime? dateTime = default(System.DateTime?), System.DateTime? effectiveDate = default(System.DateTime?), int? quarter = default(int?), int? iconCode = default(int?), string iconPhrase = default(string), string phrase = default(string), WeatherUnitRange temperature = default(WeatherUnitRange), WeatherUnitRange realFeelTemperature = default(WeatherUnitRange), WeatherUnit dewPoint = default(WeatherUnit), int? relativeHumidity = default(int?), WindDetails wind = default(WindDetails), WindDetails windGust = default(WindDetails), WeatherUnit visibility = default(WeatherUnit), int? cloudCover = default(int?), bool? hasPrecipitation = default(bool?), string precipitationType = default(string), string precipitationIntensity = default(string), int? precipitationProbability = default(int?), int? thunderstormProbability = default(int?), WeatherUnit totalLiquid = default(WeatherUnit), WeatherUnit rain = default(WeatherUnit), WeatherUnit snow = default(WeatherUnit), WeatherUnit ice = default(WeatherUnit)) + { + DateTime = dateTime; + EffectiveDate = effectiveDate; + Quarter = quarter; + IconCode = iconCode; + IconPhrase = iconPhrase; + Phrase = phrase; + Temperature = temperature; + RealFeelTemperature = realFeelTemperature; + DewPoint = dewPoint; + RelativeHumidity = relativeHumidity; + Wind = wind; + WindGust = windGust; + Visibility = visibility; + CloudCover = cloudCover; + HasPrecipitation = hasPrecipitation; + PrecipitationType = precipitationType; + PrecipitationIntensity = precipitationIntensity; + PrecipitationProbability = precipitationProbability; + ThunderstormProbability = thunderstormProbability; + TotalLiquid = totalLiquid; + Rain = rain; + Snow = snow; + Ice = ice; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets date of the forecast as example, 2019-10-27T00:00:00 + /// + [JsonProperty(PropertyName = "date")] + public System.DateTime? DateTime { get; set; } + + /// + /// Gets or sets date and time of the beginning of the forecast quarter + /// displayed in ISO 8601 format, for example, + /// 2019-10-27T19:39:57-08:00. + /// + [JsonProperty(PropertyName = "effectiveDate")] + public System.DateTime? EffectiveDate { get; set; } + + /// + /// Gets or sets quarter of the day. + /// + [JsonProperty(PropertyName = "quarter")] + public int? Quarter { get; set; } + + /// + /// + [JsonProperty(PropertyName = "iconCode")] + public int? IconCode { get; set; } + + /// + /// Gets or sets phrase description of the icon. Displayed in specified + /// language. For example, 'Sunny'. + /// + [JsonProperty(PropertyName = "iconPhrase")] + public string IconPhrase { get; set; } + + /// + /// Gets or sets short summary phrase summary for quarter. + /// + [JsonProperty(PropertyName = "phrase")] + public string Phrase { get; set; } + + /// + /// Gets or sets temperature values for the quarter. + /// + [JsonProperty(PropertyName = "temperature")] + public WeatherUnitRange Temperature { get; set; } + + /// + /// Gets or sets realFeel™ Temperature values for the quarter. + /// + [JsonProperty(PropertyName = "realFeelTemperature")] + public WeatherUnitRange RealFeelTemperature { get; set; } + + /// + /// Gets or sets the dewpoint temperature in specified unit. The + /// dewpoint temperature is the temperature that the air must be cooled + /// to in order to reach saturation. + /// + [JsonProperty(PropertyName = "dewPoint")] + public WeatherUnit DewPoint { get; set; } + + /// + /// Gets or sets relative humidity is the amount of water vapor present + /// in air expressed as a percentage of the amount needed for + /// saturation at the same temperature. + /// + [JsonProperty(PropertyName = "relativeHumidity")] + public int? RelativeHumidity { get; set; } + + /// + /// Gets or sets wind details being returned including speed and + /// direction. + /// + [JsonProperty(PropertyName = "wind")] + public WindDetails Wind { get; set; } + + /// + /// Gets or sets wind gust. Wind gust is a sudden, brief increase in + /// speed of the wind. + /// + [JsonProperty(PropertyName = "windGust")] + public WindDetails WindGust { get; set; } + + /// + /// Gets or sets visibility in specified unit. A measure of the + /// distance at which an object or light can be clearly discerned. + /// + [JsonProperty(PropertyName = "visibility")] + public WeatherUnit Visibility { get; set; } + + /// + /// Gets or sets percent representing cloud cover. + /// + [JsonProperty(PropertyName = "cloudCover")] + public int? CloudCover { get; set; } + + /// + /// Gets or sets indicates the presence or absence of precipitation. + /// True indicates the presence of precipitation, false indicates the + /// absence of precipitation. + /// + [JsonProperty(PropertyName = "hasPrecipitation")] + public bool? HasPrecipitation { get; set; } + + /// + /// Gets or sets possible values include: 'Rain', 'Snow', 'Ice', 'Mix' + /// + [JsonProperty(PropertyName = "precipitationType")] + public string PrecipitationType { get; set; } + + /// + /// Gets or sets description of the intensity. + /// + [JsonProperty(PropertyName = "precipitationIntensity")] + public string PrecipitationIntensity { get; set; } + + /// + /// Gets or sets percent representing the probability of precipitation. + /// For example, '20'. + /// + [JsonProperty(PropertyName = "precipitationProbability")] + public int? PrecipitationProbability { get; set; } + + /// + /// Gets or sets percent representing the probability of a + /// thunderstorm. For example, '10'. + /// + [JsonProperty(PropertyName = "thunderstormProbability")] + public int? ThunderstormProbability { get; set; } + + /// + /// Gets or sets total liquid equivalent of precipitation during the + /// forecast period. + /// + [JsonProperty(PropertyName = "totalLiquid")] + public WeatherUnit TotalLiquid { get; set; } + + /// + /// Gets or sets rain + /// + [JsonProperty(PropertyName = "rain")] + public WeatherUnit Rain { get; set; } + + /// + /// Gets or sets snow + /// + [JsonProperty(PropertyName = "snow")] + public WeatherUnit Snow { get; set; } + + /// + /// Gets or sets ice + /// + [JsonProperty(PropertyName = "ice")] + public WeatherUnit Ice { get; set; } + + } +} diff --git a/sdk/maps/Azure.Maps.Weather/src/Generated/Models/QuarterDayForecastResult.cs b/sdk/maps/Azure.Maps.Weather/src/Generated/Models/QuarterDayForecastResult.cs new file mode 100644 index 000000000000..dcba96587037 --- /dev/null +++ b/sdk/maps/Azure.Maps.Weather/src/Generated/Models/QuarterDayForecastResult.cs @@ -0,0 +1,51 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Azure.Maps.Weather.Models +{ + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + public partial class QuarterDayForecastResult + { + /// + /// Initializes a new instance of the QuarterDayForecastResult class. + /// + public QuarterDayForecastResult() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the QuarterDayForecastResult class. + /// + /// Forecast data for each quarter in the + /// response. + public QuarterDayForecastResult(IList forecasts = default(IList)) + { + Forecasts = forecasts; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets forecast data for each quarter in the response. + /// + [JsonProperty(PropertyName = "forecasts")] + public IList Forecasts { get; private set; } + + } +} diff --git a/sdk/maps/Azure.Maps.Weather/src/Generated/Models/RadiusSector.cs b/sdk/maps/Azure.Maps.Weather/src/Generated/Models/RadiusSector.cs new file mode 100644 index 000000000000..c5a7867c5889 --- /dev/null +++ b/sdk/maps/Azure.Maps.Weather/src/Generated/Models/RadiusSector.cs @@ -0,0 +1,71 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Azure.Maps.Weather.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Bearing 0–90 = NE quadrant; 90–180 = SE quadrant; 180–270 = SW + /// quadrant; 270–360 = NW quadrant. + /// + public partial class RadiusSector + { + /// + /// Initializes a new instance of the RadiusSector class. + /// + public RadiusSector() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the RadiusSector class. + /// + /// Bearing, in degrees, of the beginning of + /// the quadrant. + /// Bearing, in degrees, of the end of the + /// quadrant. + /// The radius of the quadrant, in nautical + /// miles. + public RadiusSector(double? beginBearing = default(double?), double? endBearing = default(double?), double? radius = default(double?)) + { + BeginBearing = beginBearing; + EndBearing = endBearing; + Radius = radius; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets bearing, in degrees, of the beginning of the quadrant. + /// + [JsonProperty(PropertyName = "beginBearing")] + public double? BeginBearing { get; set; } + + /// + /// Gets or sets bearing, in degrees, of the end of the quadrant. + /// + [JsonProperty(PropertyName = "endBearing")] + public double? EndBearing { get; set; } + + /// + /// Gets or sets the radius of the quadrant, in nautical miles. + /// + [JsonProperty(PropertyName = "range")] + public double? Radius { get; set; } + + } +} diff --git a/sdk/maps/Azure.Maps.Weather/src/Generated/Models/SevereWeatherAlert.cs b/sdk/maps/Azure.Maps.Weather/src/Generated/Models/SevereWeatherAlert.cs new file mode 100644 index 000000000000..99f32c6a6f7a --- /dev/null +++ b/sdk/maps/Azure.Maps.Weather/src/Generated/Models/SevereWeatherAlert.cs @@ -0,0 +1,168 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Azure.Maps.Weather.Models +{ + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// Information about a severe weather alert. + /// + public partial class SevereWeatherAlert + { + /// + /// Initializes a new instance of the SevereWeatherAlert class. + /// + public SevereWeatherAlert() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the SevereWeatherAlert class. + /// + /// 2-character ISO 3166-1 Alpha-2 country + /// code, for example, "US". + /// A unique numerical identifier for a weather + /// alert. + /// Description of the alert. + /// Category of the alert. + /// Number signifying the importance or ranking + /// order of the given alert within the country/region it has + /// originated. A lower number signifies a higher priority. For + /// example, 1 is the highest priority. The number varies by + /// country/region and can change over time as each country/region + /// evolves their alert systems. + /// Classification of the alert. This + /// field is not available for all countries and therefore not always + /// returned. + /// Severity level of the alert. This field is not + /// available for all countries and therefore not always + /// returned. + /// The provider of the alert information. By + /// default the source is returned in English (en-US). The alerts are + /// from official Government Meteorological Agencies and leading global + /// weather alert providers. + /// A numerical identifier associated with the + /// source provider name of the alert data. + /// A disclaimer regarding the source of the + /// alert information. This field is not always available. For example, + /// disclaimer may include details about the delays or potential issues + /// related to the alarm. + /// Information about the alert specific to + /// the affected area(s). + public SevereWeatherAlert(string countryCode = default(string), int? alertId = default(int?), SevereWeatherAlertDescription description = default(SevereWeatherAlertDescription), string category = default(string), int? priority = default(int?), string classification = default(string), string level = default(string), string source = default(string), int? sourceId = default(int?), string disclaimer = default(string), IList alertDetails = default(IList)) + { + CountryCode = countryCode; + AlertId = alertId; + Description = description; + Category = category; + Priority = priority; + Classification = classification; + Level = level; + Source = source; + SourceId = sourceId; + Disclaimer = disclaimer; + AlertDetails = alertDetails; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets 2-character ISO 3166-1 Alpha-2 country code, for + /// example, "US". + /// + [JsonProperty(PropertyName = "countryCode")] + public string CountryCode { get; set; } + + /// + /// Gets or sets a unique numerical identifier for a weather alert. + /// + [JsonProperty(PropertyName = "alertId")] + public int? AlertId { get; set; } + + /// + /// Gets or sets description of the alert. + /// + [JsonProperty(PropertyName = "description")] + public SevereWeatherAlertDescription Description { get; set; } + + /// + /// Gets or sets category of the alert. + /// + [JsonProperty(PropertyName = "category")] + public string Category { get; set; } + + /// + /// Gets or sets number signifying the importance or ranking order of + /// the given alert within the country/region it has originated. A + /// lower number signifies a higher priority. For example, 1 is the + /// highest priority. The number varies by country/region and can + /// change over time as each country/region evolves their alert + /// systems. + /// + [JsonProperty(PropertyName = "priority")] + public int? Priority { get; set; } + + /// + /// Gets or sets classification of the alert. This field is not + /// available for all countries and therefore not always returned. + /// + [JsonProperty(PropertyName = "class")] + public string Classification { get; set; } + + /// + /// Gets or sets severity level of the alert. This field is not + /// available for all countries and therefore not always returned. + /// + [JsonProperty(PropertyName = "level")] + public string Level { get; set; } + + /// + /// Gets or sets the provider of the alert information. By default the + /// source is returned in English (en-US). The alerts are from official + /// Government Meteorological Agencies and leading global weather alert + /// providers. + /// + [JsonProperty(PropertyName = "source")] + public string Source { get; set; } + + /// + /// Gets or sets a numerical identifier associated with the source + /// provider name of the alert data. + /// + [JsonProperty(PropertyName = "sourceId")] + public int? SourceId { get; set; } + + /// + /// Gets or sets a disclaimer regarding the source of the alert + /// information. This field is not always available. For example, + /// disclaimer may include details about the delays or potential issues + /// related to the alarm. + /// + [JsonProperty(PropertyName = "disclaimer")] + public string Disclaimer { get; set; } + + /// + /// Gets or sets information about the alert specific to the affected + /// area(s). + /// + [JsonProperty(PropertyName = "alertAreas")] + public IList AlertDetails { get; set; } + + } +} diff --git a/sdk/maps/Azure.Maps.Weather/src/Generated/Models/SevereWeatherAlertDescription.cs b/sdk/maps/Azure.Maps.Weather/src/Generated/Models/SevereWeatherAlertDescription.cs new file mode 100644 index 000000000000..4d4e7f0a4b22 --- /dev/null +++ b/sdk/maps/Azure.Maps.Weather/src/Generated/Models/SevereWeatherAlertDescription.cs @@ -0,0 +1,66 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Azure.Maps.Weather.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Description of a severe weather alert. + /// + public partial class SevereWeatherAlertDescription + { + /// + /// Initializes a new instance of the SevereWeatherAlertDescription + /// class. + /// + public SevereWeatherAlertDescription() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the SevereWeatherAlertDescription + /// class. + /// + /// Description of the alert in the specified + /// language. By default English (en-US) is returned if the language + /// parameter is not specified in the request. + /// Description of the alert in English + /// (en-US). + public SevereWeatherAlertDescription(string description = default(string), string status = default(string)) + { + Description = description; + Status = status; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets description of the alert in the specified language. By + /// default English (en-US) is returned if the language parameter is + /// not specified in the request. + /// + [JsonProperty(PropertyName = "localized")] + public string Description { get; set; } + + /// + /// Gets or sets description of the alert in English (en-US). + /// + [JsonProperty(PropertyName = "english")] + public string Status { get; set; } + + } +} diff --git a/sdk/maps/Azure.Maps.Weather/src/Generated/Models/SevereWeatherAlertsResult.cs b/sdk/maps/Azure.Maps.Weather/src/Generated/Models/SevereWeatherAlertsResult.cs new file mode 100644 index 000000000000..34510e6f4a1d --- /dev/null +++ b/sdk/maps/Azure.Maps.Weather/src/Generated/Models/SevereWeatherAlertsResult.cs @@ -0,0 +1,55 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Azure.Maps.Weather.Models +{ + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// This object is returned from a successful Get Severe Weather Alerts + /// call. + /// + public partial class SevereWeatherAlertsResult + { + /// + /// Initializes a new instance of the SevereWeatherAlertsResult class. + /// + public SevereWeatherAlertsResult() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the SevereWeatherAlertsResult class. + /// + /// A list of all severe weather alerts for the + /// queried location. + public SevereWeatherAlertsResult(IList results = default(IList)) + { + Results = results; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets a list of all severe weather alerts for the queried location. + /// + [JsonProperty(PropertyName = "results")] + public IList Results { get; private set; } + + } +} diff --git a/sdk/maps/Azure.Maps.Weather/src/Generated/Models/StormForecast.cs b/sdk/maps/Azure.Maps.Weather/src/Generated/Models/StormForecast.cs new file mode 100644 index 000000000000..0d9196a7ef4d --- /dev/null +++ b/sdk/maps/Azure.Maps.Weather/src/Generated/Models/StormForecast.cs @@ -0,0 +1,125 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Azure.Maps.Weather.Models +{ + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// Government-issued storm forecast + /// + public partial class StormForecast + { + /// + /// Initializes a new instance of the StormForecast class. + /// + public StormForecast() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the StormForecast class. + /// + /// Datetime the forecast is valid, displayed + /// in ISO8601 format. + /// Datetime the forecast was + /// created, displayed in ISO8601 format. + /// Coordinates of the storm + /// Maximum wind gust speed associated with + /// the storm. May be NULL. + /// Maximum sustained wind speed associated + /// with the storm. May be NULL. + /// Storm status + /// Contains information about the forecast + /// window for the storm during the specified time period (not the + /// entire cone). If windowGeometry=true in the request, this object + /// will include geoJSON details for window geometry. + /// Displayed when details=true or + /// radiiGeometry=true in the request. + public StormForecast(string timestamp = default(string), string initializedTimestamp = default(string), LatLongPair coordinates = default(LatLongPair), WeatherUnit maxWindGust = default(WeatherUnit), WeatherUnit sustainedWind = default(WeatherUnit), string status = default(string), WeatherWindow weatherWindow = default(WeatherWindow), IList windRadiiSummary = default(IList)) + { + Timestamp = timestamp; + InitializedTimestamp = initializedTimestamp; + Coordinates = coordinates; + MaxWindGust = maxWindGust; + SustainedWind = sustainedWind; + Status = status; + WeatherWindow = weatherWindow; + WindRadiiSummary = windRadiiSummary; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets datetime the forecast is valid, displayed in ISO8601 + /// format. + /// + [JsonProperty(PropertyName = "dateTime")] + public string Timestamp { get; set; } + + /// + /// Gets or sets datetime the forecast was created, displayed in + /// ISO8601 format. + /// + [JsonProperty(PropertyName = "initializedDateTime")] + public string InitializedTimestamp { get; set; } + + /// + /// Gets or sets coordinates of the storm + /// + [JsonProperty(PropertyName = "location")] + public LatLongPair Coordinates { get; set; } + + /// + /// Gets or sets maximum wind gust speed associated with the storm. May + /// be NULL. + /// + [JsonProperty(PropertyName = "maxWindGust")] + public WeatherUnit MaxWindGust { get; set; } + + /// + /// Gets or sets maximum sustained wind speed associated with the + /// storm. May be NULL. + /// + [JsonProperty(PropertyName = "sustainedWind")] + public WeatherUnit SustainedWind { get; set; } + + /// + /// Gets or sets storm status + /// + [JsonProperty(PropertyName = "status")] + public string Status { get; set; } + + /// + /// Gets or sets contains information about the forecast window for the + /// storm during the specified time period (not the entire cone). If + /// windowGeometry=true in the request, this object will include + /// geoJSON details for window geometry. + /// + [JsonProperty(PropertyName = "window")] + public WeatherWindow WeatherWindow { get; set; } + + /// + /// Gets or sets displayed when details=true or radiiGeometry=true in + /// the request. + /// + [JsonProperty(PropertyName = "windRadiiSummary")] + public IList WindRadiiSummary { get; set; } + + } +} diff --git a/sdk/maps/Azure.Maps.Weather/src/Generated/Models/StormForecastResult.cs b/sdk/maps/Azure.Maps.Weather/src/Generated/Models/StormForecastResult.cs new file mode 100644 index 000000000000..32641dd2258a --- /dev/null +++ b/sdk/maps/Azure.Maps.Weather/src/Generated/Models/StormForecastResult.cs @@ -0,0 +1,60 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Azure.Maps.Weather.Models +{ + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// The list of Government-issued forecasts + /// + public partial class StormForecastResult + { + /// + /// Initializes a new instance of the StormForecastResult class. + /// + public StormForecastResult() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the StormForecastResult class. + /// + /// The list of Government-issued + /// forecasts + public StormForecastResult(IList stormForecasts = default(IList), string nextLink = default(string)) + { + StormForecasts = stormForecasts; + NextLink = nextLink; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the list of Government-issued forecasts + /// + [JsonProperty(PropertyName = "results")] + public IList StormForecasts { get; set; } + + /// + /// + [JsonProperty(PropertyName = "nextLink")] + public string NextLink { get; set; } + + } +} diff --git a/sdk/maps/Azure.Maps.Weather/src/Generated/Models/StormLocation.cs b/sdk/maps/Azure.Maps.Weather/src/Generated/Models/StormLocation.cs new file mode 100644 index 000000000000..4e171bfa4e47 --- /dev/null +++ b/sdk/maps/Azure.Maps.Weather/src/Generated/Models/StormLocation.cs @@ -0,0 +1,148 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Azure.Maps.Weather.Models +{ + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// Location for an individual Government-issued storm + /// + public partial class StormLocation + { + /// + /// Initializes a new instance of the StormLocation class. + /// + public StormLocation() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the StormLocation class. + /// + /// Datetime the forecast is valid, displayed + /// in ISO8601 format. + /// Coordinates of the storm + /// Maximum wind gust speed associated with + /// the storm. May be NULL. + /// Maximum sustained wind speed associated + /// with the storm. May be NULL. + /// Minimum pressure associated with the + /// storm. May be NULL. + /// The storm movement information. + /// Storm status, in English. + /// True when the depression is classified + /// as a subtropical cyclone. + /// True when storm may develop into + /// a Tropical System. + /// True when the storm is weakening away, + /// and will no longer become a tropical system. + /// Displayed when details=true or + /// radiiGeometry=true in the request. + public StormLocation(string timestamp = default(string), LatLongPair coordinates = default(LatLongPair), WeatherUnit maxWindGust = default(WeatherUnit), WeatherUnit sustainedWind = default(WeatherUnit), WeatherUnit minimumPressure = default(WeatherUnit), WindDetails movement = default(WindDetails), string status = default(string), bool? isSubtropical = default(bool?), bool? hasTropicalPotential = default(bool?), bool? isPostTropical = default(bool?), IList windRadiiSummary = default(IList)) + { + Timestamp = timestamp; + Coordinates = coordinates; + MaxWindGust = maxWindGust; + SustainedWind = sustainedWind; + MinimumPressure = minimumPressure; + Movement = movement; + Status = status; + IsSubtropical = isSubtropical; + HasTropicalPotential = hasTropicalPotential; + IsPostTropical = isPostTropical; + WindRadiiSummary = windRadiiSummary; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets datetime the forecast is valid, displayed in ISO8601 + /// format. + /// + [JsonProperty(PropertyName = "dateTime")] + public string Timestamp { get; set; } + + /// + /// Gets or sets coordinates of the storm + /// + [JsonProperty(PropertyName = "location")] + public LatLongPair Coordinates { get; set; } + + /// + /// Gets or sets maximum wind gust speed associated with the storm. May + /// be NULL. + /// + [JsonProperty(PropertyName = "maxWindGust")] + public WeatherUnit MaxWindGust { get; set; } + + /// + /// Gets or sets maximum sustained wind speed associated with the + /// storm. May be NULL. + /// + [JsonProperty(PropertyName = "sustainedWind")] + public WeatherUnit SustainedWind { get; set; } + + /// + /// Gets or sets minimum pressure associated with the storm. May be + /// NULL. + /// + [JsonProperty(PropertyName = "minimumPressure")] + public WeatherUnit MinimumPressure { get; set; } + + /// + /// Gets or sets the storm movement information. + /// + [JsonProperty(PropertyName = "movement")] + public WindDetails Movement { get; set; } + + /// + /// Gets or sets storm status, in English. + /// + [JsonProperty(PropertyName = "status")] + public string Status { get; set; } + + /// + /// Gets or sets true when the depression is classified as a + /// subtropical cyclone. + /// + [JsonProperty(PropertyName = "isSubtropical")] + public bool? IsSubtropical { get; set; } + + /// + /// Gets or sets true when storm may develop into a Tropical System. + /// + [JsonProperty(PropertyName = "hasTropicalPotential")] + public bool? HasTropicalPotential { get; set; } + + /// + /// Gets or sets true when the storm is weakening away, and will no + /// longer become a tropical system. + /// + [JsonProperty(PropertyName = "isPostTropical")] + public bool? IsPostTropical { get; set; } + + /// + /// Gets or sets displayed when details=true or radiiGeometry=true in + /// the request. + /// + [JsonProperty(PropertyName = "windRadiiSummary")] + public IList WindRadiiSummary { get; set; } + + } +} diff --git a/sdk/maps/Azure.Maps.Weather/src/Generated/Models/StormLocationsResult.cs b/sdk/maps/Azure.Maps.Weather/src/Generated/Models/StormLocationsResult.cs new file mode 100644 index 000000000000..b0b9e3db8727 --- /dev/null +++ b/sdk/maps/Azure.Maps.Weather/src/Generated/Models/StormLocationsResult.cs @@ -0,0 +1,60 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Azure.Maps.Weather.Models +{ + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// Locations for an individual government-issued storm + /// + public partial class StormLocationsResult + { + /// + /// Initializes a new instance of the StormLocationsResult class. + /// + public StormLocationsResult() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the StormLocationsResult class. + /// + /// Locations for an individual + /// government-issued storm + public StormLocationsResult(IList stormLocations = default(IList), string nextLink = default(string)) + { + StormLocations = stormLocations; + NextLink = nextLink; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets locations for an individual government-issued storm + /// + [JsonProperty(PropertyName = "results")] + public IList StormLocations { get; set; } + + /// + /// + [JsonProperty(PropertyName = "nextLink")] + public string NextLink { get; set; } + + } +} diff --git a/sdk/maps/Azure.Maps.Weather/src/Generated/Models/StormSearchResult.cs b/sdk/maps/Azure.Maps.Weather/src/Generated/Models/StormSearchResult.cs new file mode 100644 index 000000000000..35fa3d1b443a --- /dev/null +++ b/sdk/maps/Azure.Maps.Weather/src/Generated/Models/StormSearchResult.cs @@ -0,0 +1,59 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Azure.Maps.Weather.Models +{ + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// Search government-issued storms + /// + public partial class StormSearchResult + { + /// + /// Initializes a new instance of the StormSearchResult class. + /// + public StormSearchResult() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the StormSearchResult class. + /// + /// Search government-issued storms + public StormSearchResult(IList storms = default(IList), string nextLink = default(string)) + { + Storms = storms; + NextLink = nextLink; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets search government-issued storms + /// + [JsonProperty(PropertyName = "results")] + public IList Storms { get; set; } + + /// + /// + [JsonProperty(PropertyName = "nextLink")] + public string NextLink { get; set; } + + } +} diff --git a/sdk/maps/Azure.Maps.Weather/src/Generated/Models/StormSearchResultItem.cs b/sdk/maps/Azure.Maps.Weather/src/Generated/Models/StormSearchResultItem.cs new file mode 100644 index 000000000000..1a58569c7f8f --- /dev/null +++ b/sdk/maps/Azure.Maps.Weather/src/Generated/Models/StormSearchResultItem.cs @@ -0,0 +1,109 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Azure.Maps.Weather.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Government-issued active storm event + /// + public partial class StormSearchResultItem + { + /// + /// Initializes a new instance of the StormSearchResultItem class. + /// + public StormSearchResultItem() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the StormSearchResultItem class. + /// + /// Year of origination + /// Basin identifier (AL, EP, SI, NI, CP, NP, + /// SP). Possible values include: 'AL', 'EP', 'SI', 'NI', 'CP', 'NP', + /// 'SP' + /// The name of the depression. + /// True if the depression has been updated + /// recently. + /// True if the storm name has been permanently + /// retired in the source basin. + /// True when the depression is classified + /// as a subtropical cyclone. + /// Government storm ID. This will match the + /// depression number. + public StormSearchResultItem(string year = default(string), string basinId = default(string), string name = default(string), bool? isActive = default(bool?), bool? isRetired = default(bool?), bool? isSubtropical = default(bool?), int? govId = default(int?)) + { + Year = year; + BasinId = basinId; + Name = name; + IsActive = isActive; + IsRetired = isRetired; + IsSubtropical = isSubtropical; + GovId = govId; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets year of origination + /// + [JsonProperty(PropertyName = "year")] + public string Year { get; set; } + + /// + /// Gets or sets basin identifier (AL, EP, SI, NI, CP, NP, SP). + /// Possible values include: 'AL', 'EP', 'SI', 'NI', 'CP', 'NP', 'SP' + /// + [JsonProperty(PropertyName = "basinId")] + public string BasinId { get; set; } + + /// + /// Gets or sets the name of the depression. + /// + [JsonProperty(PropertyName = "name")] + public string Name { get; set; } + + /// + /// Gets or sets true if the depression has been updated recently. + /// + [JsonProperty(PropertyName = "isActive")] + public bool? IsActive { get; set; } + + /// + /// Gets or sets true if the storm name has been permanently retired in + /// the source basin. + /// + [JsonProperty(PropertyName = "isRetired")] + public bool? IsRetired { get; set; } + + /// + /// Gets or sets true when the depression is classified as a + /// subtropical cyclone. + /// + [JsonProperty(PropertyName = "isSubtropical")] + public bool? IsSubtropical { get; set; } + + /// + /// Gets or sets government storm ID. This will match the depression + /// number. + /// + [JsonProperty(PropertyName = "govId")] + public int? GovId { get; set; } + + } +} diff --git a/sdk/maps/Azure.Maps.Weather/src/Generated/Models/StormWindRadiiSummary.cs b/sdk/maps/Azure.Maps.Weather/src/Generated/Models/StormWindRadiiSummary.cs new file mode 100644 index 000000000000..23e64c874dfd --- /dev/null +++ b/sdk/maps/Azure.Maps.Weather/src/Generated/Models/StormWindRadiiSummary.cs @@ -0,0 +1,87 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Azure.Maps.Weather.Models +{ + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// Displayed when details=true or radiiGeometry=true in the request. + /// + public partial class StormWindRadiiSummary + { + /// + /// Initializes a new instance of the StormWindRadiiSummary class. + /// + public StormWindRadiiSummary() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the StormWindRadiiSummary class. + /// + /// DateTime for which the wind radii summary + /// data is valid, displayed in ISO8601 format. + /// Wind speed associated with the + /// radiusSectorData. + /// Contains the information needed to + /// plot wind radius quadrants. Bearing 0–90 = NE quadrant; 90–180 = SE + /// quadrant; 180–270 = SW quadrant; 270–360 = NW quadrant. + /// GeoJSON object. Displayed when + /// radiiGeometry=true in request. Describes the outline of the wind + /// radius quadrants. + public StormWindRadiiSummary(string timestamp = default(string), WeatherUnit windSpeed = default(WeatherUnit), IList radiusSectorData = default(IList), GeoJsonGeometry radiiGeometry = default(GeoJsonGeometry)) + { + Timestamp = timestamp; + WindSpeed = windSpeed; + RadiusSectorData = radiusSectorData; + RadiiGeometry = radiiGeometry; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets dateTime for which the wind radii summary data is + /// valid, displayed in ISO8601 format. + /// + [JsonProperty(PropertyName = "dateTime")] + public string Timestamp { get; set; } + + /// + /// Gets or sets wind speed associated with the radiusSectorData. + /// + [JsonProperty(PropertyName = "windSpeed")] + public WeatherUnit WindSpeed { get; set; } + + /// + /// Gets or sets contains the information needed to plot wind radius + /// quadrants. Bearing 0–90 = NE quadrant; 90–180 = SE quadrant; + /// 180–270 = SW quadrant; 270–360 = NW quadrant. + /// + [JsonProperty(PropertyName = "radiusSectorData")] + public IList RadiusSectorData { get; set; } + + /// + /// Gets or sets geoJSON object. Displayed when radiiGeometry=true in + /// request. Describes the outline of the wind radius quadrants. + /// + [JsonProperty(PropertyName = "radiiGeometry")] + public GeoJsonGeometry RadiiGeometry { get; set; } + + } +} diff --git a/sdk/maps/Azure.Maps.Weather/src/Generated/Models/SunGlare.cs b/sdk/maps/Azure.Maps.Weather/src/Generated/Models/SunGlare.cs new file mode 100644 index 000000000000..1b73ddb94daa --- /dev/null +++ b/sdk/maps/Azure.Maps.Weather/src/Generated/Models/SunGlare.cs @@ -0,0 +1,73 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Azure.Maps.Weather.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// A rating that indicates how blinding the sun is for the driver. + /// + public partial class SunGlare + { + /// + /// Initializes a new instance of the SunGlare class. + /// + public SunGlare() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the SunGlare class. + /// + /// If the vehicle heading value + /// is not provided for a waypoint, then the service will calculate a + /// heading based upon the location of neighboring waypoints if + /// provided. + /// An index from 0 to 100 indicating sun + /// glare intensity for a driver. A value of 50 and above can be + /// considered a hazard for some drivers and a value of 100 signifies + /// the driver is driving straight into the sun and atmospheric + /// conditions are clear allowing for the full intensity of the sun to + /// blind the driver. + public SunGlare(int? calculatedVehicleHeading = default(int?), int? glareIndex = default(int?)) + { + CalculatedVehicleHeading = calculatedVehicleHeading; + GlareIndex = glareIndex; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets if the vehicle heading value is not provided for a + /// waypoint, then the service will calculate a heading based upon the + /// location of neighboring waypoints if provided. + /// + [JsonProperty(PropertyName = "calculatedVehicleHeading")] + public int? CalculatedVehicleHeading { get; set; } + + /// + /// Gets or sets an index from 0 to 100 indicating sun glare intensity + /// for a driver. A value of 50 and above can be considered a hazard + /// for some drivers and a value of 100 signifies the driver is driving + /// straight into the sun and atmospheric conditions are clear allowing + /// for the full intensity of the sun to blind the driver. + /// + [JsonProperty(PropertyName = "glareIndex")] + public int? GlareIndex { get; set; } + + } +} diff --git a/sdk/maps/Azure.Maps.Weather/src/Generated/Models/TemperatureSummary.cs b/sdk/maps/Azure.Maps.Weather/src/Generated/Models/TemperatureSummary.cs new file mode 100644 index 000000000000..293f4c3f8196 --- /dev/null +++ b/sdk/maps/Azure.Maps.Weather/src/Generated/Models/TemperatureSummary.cs @@ -0,0 +1,70 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Azure.Maps.Weather.Models +{ + using Newtonsoft.Json; + using System.Linq; + + public partial class TemperatureSummary + { + /// + /// Initializes a new instance of the TemperatureSummary class. + /// + public TemperatureSummary() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the TemperatureSummary class. + /// + /// Summary of temperature fluctuations over + /// the past 6 hours. + /// Summary of temperature fluctuations + /// over the past 12 hours. + /// Summary of temperature + /// fluctuations over the past 24 hours. + public TemperatureSummary(PastHoursTemperature pastSixHours = default(PastHoursTemperature), PastHoursTemperature pastTwelveHours = default(PastHoursTemperature), PastHoursTemperature pastTwentyFourHours = default(PastHoursTemperature)) + { + PastSixHours = pastSixHours; + PastTwelveHours = pastTwelveHours; + PastTwentyFourHours = pastTwentyFourHours; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets summary of temperature fluctuations over the past 6 + /// hours. + /// + [JsonProperty(PropertyName = "pastSixHours")] + public PastHoursTemperature PastSixHours { get; set; } + + /// + /// Gets or sets summary of temperature fluctuations over the past 12 + /// hours. + /// + [JsonProperty(PropertyName = "pastTwelveHours")] + public PastHoursTemperature PastTwelveHours { get; set; } + + /// + /// Gets or sets summary of temperature fluctuations over the past 24 + /// hours. + /// + [JsonProperty(PropertyName = "pastTwentyFourHours")] + public PastHoursTemperature PastTwentyFourHours { get; set; } + + } +} diff --git a/sdk/maps/Azure.Maps.Weather/src/Generated/Models/WeatherAlongRoutePrecipitation.cs b/sdk/maps/Azure.Maps.Weather/src/Generated/Models/WeatherAlongRoutePrecipitation.cs new file mode 100644 index 000000000000..c95d8cec55b4 --- /dev/null +++ b/sdk/maps/Azure.Maps.Weather/src/Generated/Models/WeatherAlongRoutePrecipitation.cs @@ -0,0 +1,66 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Azure.Maps.Weather.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Precipitation forecast of the weather along the route. + /// + public partial class WeatherAlongRoutePrecipitation + { + /// + /// Initializes a new instance of the WeatherAlongRoutePrecipitation + /// class. + /// + public WeatherAlongRoutePrecipitation() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the WeatherAlongRoutePrecipitation + /// class. + /// + /// The forecasted precipitation intensity in dBZ + /// (decibels relative to Z) from 0.0 to 100.0. + /// Precipitation type. If precipitation should + /// occur, the type that it will be: "RAIN," "HAIL," "SNOW," "ICE," or + /// "MIX." + public WeatherAlongRoutePrecipitation(double? dbz = default(double?), string type = default(string)) + { + Dbz = dbz; + Type = type; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the forecasted precipitation intensity in dBZ + /// (decibels relative to Z) from 0.0 to 100.0. + /// + [JsonProperty(PropertyName = "dbz")] + public double? Dbz { get; set; } + + /// + /// Gets or sets precipitation type. If precipitation should occur, the + /// type that it will be: "RAIN," "HAIL," "SNOW," "ICE," or "MIX." + /// + [JsonProperty(PropertyName = "type")] + public string Type { get; set; } + + } +} diff --git a/sdk/maps/Azure.Maps.Weather/src/Generated/Models/WeatherAlongRouteResult.cs b/sdk/maps/Azure.Maps.Weather/src/Generated/Models/WeatherAlongRouteResult.cs new file mode 100644 index 000000000000..6a16a0e2abce --- /dev/null +++ b/sdk/maps/Azure.Maps.Weather/src/Generated/Models/WeatherAlongRouteResult.cs @@ -0,0 +1,61 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Azure.Maps.Weather.Models +{ + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// This object is returned from a successful Weather Along Route. + /// + public partial class WeatherAlongRouteResult + { + /// + /// Initializes a new instance of the WeatherAlongRouteResult class. + /// + public WeatherAlongRouteResult() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the WeatherAlongRouteResult class. + /// + /// Data for each waypoint returned in the same + /// order as specified in the request. + public WeatherAlongRouteResult(WeatherAlongRouteSummary summary = default(WeatherAlongRouteSummary), IList waypoints = default(IList)) + { + Summary = summary; + Waypoints = waypoints; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// + [JsonProperty(PropertyName = "summary")] + public WeatherAlongRouteSummary Summary { get; private set; } + + /// + /// Gets data for each waypoint returned in the same order as specified + /// in the request. + /// + [JsonProperty(PropertyName = "waypoints")] + public IList Waypoints { get; private set; } + + } +} diff --git a/sdk/maps/Azure.Maps.Weather/src/Generated/Models/WeatherAlongRouteSummary.cs b/sdk/maps/Azure.Maps.Weather/src/Generated/Models/WeatherAlongRouteSummary.cs new file mode 100644 index 000000000000..83b6731a5c6e --- /dev/null +++ b/sdk/maps/Azure.Maps.Weather/src/Generated/Models/WeatherAlongRouteSummary.cs @@ -0,0 +1,55 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Azure.Maps.Weather.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Short summary of the weather along the route. + /// + public partial class WeatherAlongRouteSummary + { + /// + /// Initializes a new instance of the WeatherAlongRouteSummary class. + /// + public WeatherAlongRouteSummary() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the WeatherAlongRouteSummary class. + /// + public WeatherAlongRouteSummary(int? iconCode = default(int?), WeatherHazards hazards = default(WeatherHazards)) + { + IconCode = iconCode; + Hazards = hazards; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// + [JsonProperty(PropertyName = "iconCode")] + public int? IconCode { get; set; } + + /// + /// + [JsonProperty(PropertyName = "hazards")] + public WeatherHazards Hazards { get; set; } + + } +} diff --git a/sdk/maps/Azure.Maps.Weather/src/Generated/Models/WeatherDataUnit.cs b/sdk/maps/Azure.Maps.Weather/src/Generated/Models/WeatherDataUnit.cs new file mode 100644 index 000000000000..2896d81476e0 --- /dev/null +++ b/sdk/maps/Azure.Maps.Weather/src/Generated/Models/WeatherDataUnit.cs @@ -0,0 +1,30 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Azure.Maps.Weather.Models +{ + + /// + /// Defines values for WeatherDataUnit. + /// + public static class WeatherDataUnit + { + /// + /// Return data in metric units. Some example units of metric system + /// are Celsius and kilometer. + /// + public const string Metric = "metric"; + /// + /// Return data in imperial units. Some example units of imperial + /// system are Fahrenheit and mile. + /// + public const string Imperial = "imperial"; + } +} diff --git a/sdk/maps/Azure.Maps.Weather/src/Generated/Models/WeatherHazards.cs b/sdk/maps/Azure.Maps.Weather/src/Generated/Models/WeatherHazards.cs new file mode 100644 index 000000000000..47c9b3b58533 --- /dev/null +++ b/sdk/maps/Azure.Maps.Weather/src/Generated/Models/WeatherHazards.cs @@ -0,0 +1,60 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Azure.Maps.Weather.Models +{ + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// Description of the weather hazard affecting the trip. + /// + public partial class WeatherHazards + { + /// + /// Initializes a new instance of the WeatherHazards class. + /// + public WeatherHazards() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the WeatherHazards class. + /// + /// Details of the weather hazards affecting the + /// trip. + public WeatherHazards(int? maxHazardIndex = default(int?), IList details = default(IList)) + { + MaxHazardIndex = maxHazardIndex; + Details = details; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// + [JsonProperty(PropertyName = "maxHazardIndex")] + public int? MaxHazardIndex { get; set; } + + /// + /// Gets or sets details of the weather hazards affecting the trip. + /// + [JsonProperty(PropertyName = "hazardDetails")] + public IList Details { get; set; } + + } +} diff --git a/sdk/maps/Azure.Maps.Weather/src/Generated/Models/WeatherNotification.cs b/sdk/maps/Azure.Maps.Weather/src/Generated/Models/WeatherNotification.cs new file mode 100644 index 000000000000..50b650076c92 --- /dev/null +++ b/sdk/maps/Azure.Maps.Weather/src/Generated/Models/WeatherNotification.cs @@ -0,0 +1,88 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Azure.Maps.Weather.Models +{ + using Newtonsoft.Json; + using System.Linq; + + public partial class WeatherNotification + { + /// + /// Initializes a new instance of the WeatherNotification class. + /// + public WeatherNotification() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the WeatherNotification class. + /// + /// A type of notification generated to warn drivers + /// of the onset of a hazard, or increase in intensity of a + /// hazard. + /// A unique identifier (non-displayable) for + /// each type of hazard: LightRain, ModerateRain, HeavyRain, LightMix, + /// ModerateMix, HeavyMix, LightSnow, ModerateSnow, HeavySnow, + /// LightIce, ModerateIce, HeavyIce, Hail, LargeHail, SunGlare, + /// SunGlareHigh, Lightning, SevereLightning, WindModerate, WindHigh, + /// WindExtreme, FloodWarning, FlashFloodWarning, TornadoWarning, + /// TsunamiWarning, SevereThunderstormWarning. + /// A displayable short phrase + /// describing the forecasted conditions and precipitation + /// intensity/type. + public WeatherNotification(string type = default(string), int? hazardIndex = default(int?), string hazardCode = default(string), string shortDescription = default(string)) + { + Type = type; + HazardIndex = hazardIndex; + HazardCode = hazardCode; + ShortDescription = shortDescription; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets a type of notification generated to warn drivers of + /// the onset of a hazard, or increase in intensity of a hazard. + /// + [JsonProperty(PropertyName = "type")] + public string Type { get; set; } + + /// + /// + [JsonProperty(PropertyName = "hazardIndex")] + public int? HazardIndex { get; set; } + + /// + /// Gets or sets a unique identifier (non-displayable) for each type of + /// hazard: LightRain, ModerateRain, HeavyRain, LightMix, ModerateMix, + /// HeavyMix, LightSnow, ModerateSnow, HeavySnow, LightIce, + /// ModerateIce, HeavyIce, Hail, LargeHail, SunGlare, SunGlareHigh, + /// Lightning, SevereLightning, WindModerate, WindHigh, WindExtreme, + /// FloodWarning, FlashFloodWarning, TornadoWarning, TsunamiWarning, + /// SevereThunderstormWarning. + /// + [JsonProperty(PropertyName = "hazardCode")] + public string HazardCode { get; set; } + + /// + /// Gets or sets a displayable short phrase describing the forecasted + /// conditions and precipitation intensity/type. + /// + [JsonProperty(PropertyName = "shortPhrase")] + public string ShortDescription { get; set; } + + } +} diff --git a/sdk/maps/Azure.Maps.Weather/src/Generated/Models/WeatherUnit.cs b/sdk/maps/Azure.Maps.Weather/src/Generated/Models/WeatherUnit.cs new file mode 100644 index 000000000000..d920e895807b --- /dev/null +++ b/sdk/maps/Azure.Maps.Weather/src/Generated/Models/WeatherUnit.cs @@ -0,0 +1,66 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Azure.Maps.Weather.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Specific value of a given unit related to weather. + /// + public partial class WeatherUnit + { + /// + /// Initializes a new instance of the WeatherUnit class. + /// + public WeatherUnit() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the WeatherUnit class. + /// + /// Rounded value. + /// Type of unit for the returned + /// value. + public WeatherUnit(double? value = default(double?), string unitLabel = default(string), int? unitType = default(int?)) + { + Value = value; + UnitLabel = unitLabel; + UnitType = unitType; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets rounded value. + /// + [JsonProperty(PropertyName = "value")] + public double? Value { get; set; } + + /// + /// Gets or sets type of unit for the returned value. + /// + [JsonProperty(PropertyName = "unit")] + public string UnitLabel { get; set; } + + /// + /// + [JsonProperty(PropertyName = "unitType")] + public int? UnitType { get; set; } + + } +} diff --git a/sdk/maps/Azure.Maps.Weather/src/Generated/Models/WeatherUnitMaxMinAvg.cs b/sdk/maps/Azure.Maps.Weather/src/Generated/Models/WeatherUnitMaxMinAvg.cs new file mode 100644 index 000000000000..7598f8306369 --- /dev/null +++ b/sdk/maps/Azure.Maps.Weather/src/Generated/Models/WeatherUnitMaxMinAvg.cs @@ -0,0 +1,70 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Azure.Maps.Weather.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Returned temperature values. + /// + public partial class WeatherUnitMaxMinAvg + { + /// + /// Initializes a new instance of the WeatherUnitMaxMinAvg class. + /// + public WeatherUnitMaxMinAvg() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the WeatherUnitMaxMinAvg class. + /// + /// Maximum temperature for the time + /// period. + /// Minimum temperature for the time + /// period. + /// Average temperature for the time + /// period. + public WeatherUnitMaxMinAvg(WeatherUnit maximum = default(WeatherUnit), WeatherUnit minimum = default(WeatherUnit), WeatherUnit average = default(WeatherUnit)) + { + Maximum = maximum; + Minimum = minimum; + Average = average; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets maximum temperature for the time period. + /// + [JsonProperty(PropertyName = "maximum")] + public WeatherUnit Maximum { get; set; } + + /// + /// Gets or sets minimum temperature for the time period. + /// + [JsonProperty(PropertyName = "minimum")] + public WeatherUnit Minimum { get; set; } + + /// + /// Gets or sets average temperature for the time period. + /// + [JsonProperty(PropertyName = "average")] + public WeatherUnit Average { get; set; } + + } +} diff --git a/sdk/maps/Azure.Maps.Weather/src/Generated/Models/WeatherUnitRange.cs b/sdk/maps/Azure.Maps.Weather/src/Generated/Models/WeatherUnitRange.cs new file mode 100644 index 000000000000..561cfd75fae3 --- /dev/null +++ b/sdk/maps/Azure.Maps.Weather/src/Generated/Models/WeatherUnitRange.cs @@ -0,0 +1,61 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Azure.Maps.Weather.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Returned temperature values. + /// + public partial class WeatherUnitRange + { + /// + /// Initializes a new instance of the WeatherUnitRange class. + /// + public WeatherUnitRange() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the WeatherUnitRange class. + /// + /// Minimum temperature for the time + /// period. + /// Maximum temperature for the time + /// period + public WeatherUnitRange(WeatherUnit minimum = default(WeatherUnit), WeatherUnit maximum = default(WeatherUnit)) + { + Minimum = minimum; + Maximum = maximum; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets minimum temperature for the time period. + /// + [JsonProperty(PropertyName = "minimum")] + public WeatherUnit Minimum { get; set; } + + /// + /// Gets or sets maximum temperature for the time period + /// + [JsonProperty(PropertyName = "maximum")] + public WeatherUnit Maximum { get; set; } + + } +} diff --git a/sdk/maps/Azure.Maps.Weather/src/Generated/Models/WeatherUnitYear.cs b/sdk/maps/Azure.Maps.Weather/src/Generated/Models/WeatherUnitYear.cs new file mode 100644 index 000000000000..cbf8988a8234 --- /dev/null +++ b/sdk/maps/Azure.Maps.Weather/src/Generated/Models/WeatherUnitYear.cs @@ -0,0 +1,79 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Azure.Maps.Weather.Models +{ + using Newtonsoft.Json; + using System.Linq; + + public partial class WeatherUnitYear + { + /// + /// Initializes a new instance of the WeatherUnitYear class. + /// + public WeatherUnitYear() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the WeatherUnitYear class. + /// + /// Rounded value. + /// Type of unit for the returned value. + /// Numeric ID value associated with the type of + /// unit being displayed. Can be used for unit translation. Please + /// refer to [Weather Service + /// Concepts](https://aka.ms/AzureMapsWeatherConcepts) for + /// details. + /// Year the value occurred. + public WeatherUnitYear(double? value = default(double?), string unit = default(string), int? unitType = default(int?), int? year = default(int?)) + { + Value = value; + Unit = unit; + UnitType = unitType; + Year = year; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets rounded value. + /// + [JsonProperty(PropertyName = "value")] + public double? Value { get; set; } + + /// + /// Gets or sets type of unit for the returned value. + /// + [JsonProperty(PropertyName = "unit")] + public string Unit { get; set; } + + /// + /// Gets or sets numeric ID value associated with the type of unit + /// being displayed. Can be used for unit translation. Please refer to + /// [Weather Service Concepts](https://aka.ms/AzureMapsWeatherConcepts) + /// for details. + /// + [JsonProperty(PropertyName = "unitType")] + public int? UnitType { get; set; } + + /// + /// Gets or sets year the value occurred. + /// + [JsonProperty(PropertyName = "year")] + public int? Year { get; set; } + + } +} diff --git a/sdk/maps/Azure.Maps.Weather/src/Generated/Models/WeatherUnitYearMax.cs b/sdk/maps/Azure.Maps.Weather/src/Generated/Models/WeatherUnitYearMax.cs new file mode 100644 index 000000000000..102199861237 --- /dev/null +++ b/sdk/maps/Azure.Maps.Weather/src/Generated/Models/WeatherUnitYearMax.cs @@ -0,0 +1,52 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Azure.Maps.Weather.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Returned temperature values. + /// + public partial class WeatherUnitYearMax + { + /// + /// Initializes a new instance of the WeatherUnitYearMax class. + /// + public WeatherUnitYearMax() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the WeatherUnitYearMax class. + /// + /// Maximum temperature for the time + /// period. + public WeatherUnitYearMax(WeatherUnitYear maximum = default(WeatherUnitYear)) + { + Maximum = maximum; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets maximum temperature for the time period. + /// + [JsonProperty(PropertyName = "maximum")] + public WeatherUnitYear Maximum { get; set; } + + } +} diff --git a/sdk/maps/Azure.Maps.Weather/src/Generated/Models/WeatherUnitYearMaxMinAvg.cs b/sdk/maps/Azure.Maps.Weather/src/Generated/Models/WeatherUnitYearMaxMinAvg.cs new file mode 100644 index 000000000000..31ead33c37c9 --- /dev/null +++ b/sdk/maps/Azure.Maps.Weather/src/Generated/Models/WeatherUnitYearMaxMinAvg.cs @@ -0,0 +1,70 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Azure.Maps.Weather.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Returned temperature values. + /// + public partial class WeatherUnitYearMaxMinAvg + { + /// + /// Initializes a new instance of the WeatherUnitYearMaxMinAvg class. + /// + public WeatherUnitYearMaxMinAvg() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the WeatherUnitYearMaxMinAvg class. + /// + /// Maximum temperature for the time + /// period. + /// Minimum temperature for the time + /// period. + /// Average temperature for the time + /// period. + public WeatherUnitYearMaxMinAvg(WeatherUnitYear maximum = default(WeatherUnitYear), WeatherUnitYear minimum = default(WeatherUnitYear), WeatherUnit average = default(WeatherUnit)) + { + Maximum = maximum; + Minimum = minimum; + Average = average; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets maximum temperature for the time period. + /// + [JsonProperty(PropertyName = "maximum")] + public WeatherUnitYear Maximum { get; set; } + + /// + /// Gets or sets minimum temperature for the time period. + /// + [JsonProperty(PropertyName = "minimum")] + public WeatherUnitYear Minimum { get; set; } + + /// + /// Gets or sets average temperature for the time period. + /// + [JsonProperty(PropertyName = "average")] + public WeatherUnit Average { get; set; } + + } +} diff --git a/sdk/maps/Azure.Maps.Weather/src/Generated/Models/WeatherWaypoint.cs b/sdk/maps/Azure.Maps.Weather/src/Generated/Models/WeatherWaypoint.cs new file mode 100644 index 000000000000..ba2219ed9da6 --- /dev/null +++ b/sdk/maps/Azure.Maps.Weather/src/Generated/Models/WeatherWaypoint.cs @@ -0,0 +1,139 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Azure.Maps.Weather.Models +{ + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + public partial class WeatherWaypoint + { + /// + /// Initializes a new instance of the WeatherWaypoint class. + /// + public WeatherWaypoint() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the WeatherWaypoint class. + /// + /// A displayable short phrase + /// describing the forecasted conditions and precipitation + /// intensity/type. + /// Indicates the time of the day. True + /// indicates 'day',', false indicates 'night. + /// Percent representing cloud cover. + /// Estimation of thunderstorm intensity + /// on an open scale. A value of 0 means there is no thunderstorm; + /// values of 1 and higher mean there is a thunderstorm in increasing + /// intensity. + /// A rating that indicates how blinding the sun + /// is for the driver. + /// List of weather hazard + /// notifications. + public WeatherWaypoint(int? iconCode = default(int?), string shortDescription = default(string), bool? isDaytime = default(bool?), int? cloudCover = default(int?), WeatherUnit temperature = default(WeatherUnit), WindDetails wind = default(WindDetails), WindDetails windGust = default(WindDetails), WeatherAlongRoutePrecipitation precipitation = default(WeatherAlongRoutePrecipitation), int? lightningCount = default(int?), SunGlare sunGlare = default(SunGlare), WeatherHazards hazards = default(WeatherHazards), IList notifications = default(IList)) + { + IconCode = iconCode; + ShortDescription = shortDescription; + IsDaytime = isDaytime; + CloudCover = cloudCover; + Temperature = temperature; + Wind = wind; + WindGust = windGust; + Precipitation = precipitation; + LightningCount = lightningCount; + SunGlare = sunGlare; + Hazards = hazards; + Notifications = notifications; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// + [JsonProperty(PropertyName = "iconCode")] + public int? IconCode { get; set; } + + /// + /// Gets or sets a displayable short phrase describing the forecasted + /// conditions and precipitation intensity/type. + /// + [JsonProperty(PropertyName = "shortPhrase")] + public string ShortDescription { get; set; } + + /// + /// Gets or sets indicates the time of the day. True indicates 'day',', + /// false indicates 'night. + /// + [JsonProperty(PropertyName = "isDayTime")] + public bool? IsDaytime { get; set; } + + /// + /// Gets or sets percent representing cloud cover. + /// + [JsonProperty(PropertyName = "cloudCover")] + public int? CloudCover { get; set; } + + /// + /// + [JsonProperty(PropertyName = "temperature")] + public WeatherUnit Temperature { get; set; } + + /// + /// + [JsonProperty(PropertyName = "wind")] + public WindDetails Wind { get; set; } + + /// + /// + [JsonProperty(PropertyName = "windGust")] + public WindDetails WindGust { get; set; } + + /// + /// + [JsonProperty(PropertyName = "precipitation")] + public WeatherAlongRoutePrecipitation Precipitation { get; set; } + + /// + /// Gets or sets estimation of thunderstorm intensity on an open scale. + /// A value of 0 means there is no thunderstorm; values of 1 and higher + /// mean there is a thunderstorm in increasing intensity. + /// + [JsonProperty(PropertyName = "lightningCount")] + public int? LightningCount { get; set; } + + /// + /// Gets or sets a rating that indicates how blinding the sun is for + /// the driver. + /// + [JsonProperty(PropertyName = "sunGlare")] + public SunGlare SunGlare { get; set; } + + /// + /// + [JsonProperty(PropertyName = "hazards")] + public WeatherHazards Hazards { get; set; } + + /// + /// Gets or sets list of weather hazard notifications. + /// + [JsonProperty(PropertyName = "notifications")] + public IList Notifications { get; set; } + + } +} diff --git a/sdk/maps/Azure.Maps.Weather/src/Generated/Models/WeatherWindow.cs b/sdk/maps/Azure.Maps.Weather/src/Generated/Models/WeatherWindow.cs new file mode 100644 index 000000000000..8475209f32c2 --- /dev/null +++ b/sdk/maps/Azure.Maps.Weather/src/Generated/Models/WeatherWindow.cs @@ -0,0 +1,113 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Azure.Maps.Weather.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Forecast window for the storm + /// + public partial class WeatherWindow + { + /// + /// Initializes a new instance of the WeatherWindow class. + /// + public WeatherWindow() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the WeatherWindow class. + /// + /// Location of the point on the left side of the + /// window at the time of the timeframe. + /// Location of the point on the right side + /// of the window at the end of the timeframe. + /// DateTime of the beginning of the + /// window of movement, displayed in ISO8601 format. + /// DateTime of the end of the window of + /// movement, displayed in ISO8601 format. + /// Storm status at the beginning of the + /// window. + /// Storm status at the end of the + /// window. + /// Displayed when windowGeometry=true in + /// request. GeoJSON object containing coordinates describing the + /// window of movement during the specified timeframe. + public WeatherWindow(LatLongPair topLeft = default(LatLongPair), LatLongPair bottomRight = default(LatLongPair), System.DateTime? beginTimestamp = default(System.DateTime?), System.DateTime? endTimestamp = default(System.DateTime?), string beginStatus = default(string), string endStatus = default(string), GeoJsonGeometry geometry = default(GeoJsonGeometry)) + { + TopLeft = topLeft; + BottomRight = bottomRight; + BeginTimestamp = beginTimestamp; + EndTimestamp = endTimestamp; + BeginStatus = beginStatus; + EndStatus = endStatus; + Geometry = geometry; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets location of the point on the left side of the window + /// at the time of the timeframe. + /// + [JsonProperty(PropertyName = "left")] + public LatLongPair TopLeft { get; set; } + + /// + /// Gets or sets location of the point on the right side of the window + /// at the end of the timeframe. + /// + [JsonProperty(PropertyName = "right")] + public LatLongPair BottomRight { get; set; } + + /// + /// Gets or sets dateTime of the beginning of the window of movement, + /// displayed in ISO8601 format. + /// + [JsonProperty(PropertyName = "beginDateTime")] + public System.DateTime? BeginTimestamp { get; set; } + + /// + /// Gets or sets dateTime of the end of the window of movement, + /// displayed in ISO8601 format. + /// + [JsonProperty(PropertyName = "endDateTime")] + public System.DateTime? EndTimestamp { get; set; } + + /// + /// Gets or sets storm status at the beginning of the window. + /// + [JsonProperty(PropertyName = "beginStatus")] + public string BeginStatus { get; set; } + + /// + /// Gets or sets storm status at the end of the window. + /// + [JsonProperty(PropertyName = "endStatus")] + public string EndStatus { get; set; } + + /// + /// Gets or sets displayed when windowGeometry=true in request. GeoJSON + /// object containing coordinates describing the window of movement + /// during the specified timeframe. + /// + [JsonProperty(PropertyName = "geometry")] + public GeoJsonGeometry Geometry { get; set; } + + } +} diff --git a/sdk/maps/Azure.Maps.Weather/src/Generated/Models/WindDetails.cs b/sdk/maps/Azure.Maps.Weather/src/Generated/Models/WindDetails.cs new file mode 100644 index 000000000000..fc598605131c --- /dev/null +++ b/sdk/maps/Azure.Maps.Weather/src/Generated/Models/WindDetails.cs @@ -0,0 +1,59 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Azure.Maps.Weather.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Wind details being returned including speed and direction. + /// + public partial class WindDetails + { + /// + /// Initializes a new instance of the WindDetails class. + /// + public WindDetails() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the WindDetails class. + /// + /// Wind direction + /// Speed of the wind in specified unit. + public WindDetails(WindDirection direction = default(WindDirection), WeatherUnit speed = default(WeatherUnit)) + { + Direction = direction; + Speed = speed; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets wind direction + /// + [JsonProperty(PropertyName = "direction")] + public WindDirection Direction { get; set; } + + /// + /// Gets or sets speed of the wind in specified unit. + /// + [JsonProperty(PropertyName = "speed")] + public WeatherUnit Speed { get; set; } + + } +} diff --git a/sdk/maps/Azure.Maps.Weather/src/Generated/Models/WindDirection.cs b/sdk/maps/Azure.Maps.Weather/src/Generated/Models/WindDirection.cs new file mode 100644 index 000000000000..ad40b086c337 --- /dev/null +++ b/sdk/maps/Azure.Maps.Weather/src/Generated/Models/WindDirection.cs @@ -0,0 +1,66 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Azure.Maps.Weather.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Wind direction + /// + public partial class WindDirection + { + /// + /// Initializes a new instance of the WindDirection class. + /// + public WindDirection() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the WindDirection class. + /// + /// Wind direction in Azimuth degrees, starting + /// at true North and continuing in clockwise direction. North is 0 + /// degrees, east is 90 degrees, south is 180 degrees, west is 270 + /// degrees. Possible values 0-359. + /// Direction abbreviation in the specified + /// language. + public WindDirection(int? degrees = default(int?), string description = default(string)) + { + Degrees = degrees; + Description = description; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets wind direction in Azimuth degrees, starting at true + /// North and continuing in clockwise direction. North is 0 degrees, + /// east is 90 degrees, south is 180 degrees, west is 270 degrees. + /// Possible values 0-359. + /// + [JsonProperty(PropertyName = "degrees")] + public int? Degrees { get; set; } + + /// + /// Gets or sets direction abbreviation in the specified language. + /// + [JsonProperty(PropertyName = "localizedDescription")] + public string Description { get; set; } + + } +} diff --git a/sdk/maps/Azure.Maps.Weather/src/Generated/SdkInfo_WeatherClient.cs b/sdk/maps/Azure.Maps.Weather/src/Generated/SdkInfo_WeatherClient.cs new file mode 100644 index 000000000000..e71a26386438 --- /dev/null +++ b/sdk/maps/Azure.Maps.Weather/src/Generated/SdkInfo_WeatherClient.cs @@ -0,0 +1,27 @@ + +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Azure.Maps.Weather +{ + using System; + using System.Collections.Generic; + using System.Linq; + + internal static partial class SdkInfo + { + public static IEnumerable> ApiInfo_WeatherClient + { + get + { + return new Tuple[] + { + new Tuple("WeatherClient", "Weather", "1.1"), + }.AsEnumerable(); + } + } + } +} diff --git a/sdk/maps/Azure.Maps.Weather/src/Generated/WeatherClient.cs b/sdk/maps/Azure.Maps.Weather/src/Generated/WeatherClient.cs new file mode 100644 index 000000000000..3b33396c4263 --- /dev/null +++ b/sdk/maps/Azure.Maps.Weather/src/Generated/WeatherClient.cs @@ -0,0 +1,336 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Azure.Maps.Weather +{ + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Models; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Net; + using System.Net.Http; + + public partial class WeatherClient : ServiceClient, IWeatherClient + { + /// + /// The base URI of the service. + /// + public System.Uri BaseUri { get; set; } + + /// + /// Gets or sets json serialization settings. + /// + public JsonSerializerSettings SerializationSettings { get; private set; } + + /// + /// Gets or sets json deserialization settings. + /// + public JsonSerializerSettings DeserializationSettings { get; private set; } + + /// + /// Version number of Azure Maps API. + /// + public string ApiVersion { get; set; } + + /// + /// Specifies which account is intended for usage in conjunction with the Azure + /// AD security model. It represents a unique ID for the Azure Maps account + /// and can be retrieved from the Azure Maps management plane Account API. To + /// use Azure AD security in Azure Maps see the following + /// [articles](https://aka.ms/amauthdetails) for guidance. + /// + public string ClientId { get; set; } + + /// + /// Subscription credentials which uniquely identify client subscription. + /// + public ServiceClientCredentials Credentials { get; private set; } + + /// + /// Gets the IWeatherOperations. + /// + public virtual IWeatherOperations Weather { get; private set; } + + /// + /// Initializes a new instance of the WeatherClient class. + /// + /// + /// HttpClient to be used + /// + /// + /// True: will dispose the provided httpClient on calling WeatherClient.Dispose(). False: will not dispose provided httpClient + protected WeatherClient(HttpClient httpClient, bool disposeHttpClient) : base(httpClient, disposeHttpClient) + { + Initialize(); + } + + /// + /// Initializes a new instance of the WeatherClient class. + /// + /// + /// Optional. The delegating handlers to add to the http client pipeline. + /// + protected WeatherClient(params DelegatingHandler[] handlers) : base(handlers) + { + Initialize(); + } + + /// + /// Initializes a new instance of the WeatherClient class. + /// + /// + /// Optional. The http client handler used to handle http transport. + /// + /// + /// Optional. The delegating handlers to add to the http client pipeline. + /// + protected WeatherClient(HttpClientHandler rootHandler, params DelegatingHandler[] handlers) : base(rootHandler, handlers) + { + Initialize(); + } + + /// + /// Initializes a new instance of the WeatherClient class. + /// + /// + /// Optional. The base URI of the service. + /// + /// + /// Optional. The delegating handlers to add to the http client pipeline. + /// + /// + /// Thrown when a required parameter is null + /// + protected WeatherClient(System.Uri baseUri, params DelegatingHandler[] handlers) : this(handlers) + { + if (baseUri == null) + { + throw new System.ArgumentNullException("baseUri"); + } + BaseUri = baseUri; + } + + /// + /// Initializes a new instance of the WeatherClient class. + /// + /// + /// Optional. The base URI of the service. + /// + /// + /// Optional. The http client handler used to handle http transport. + /// + /// + /// Optional. The delegating handlers to add to the http client pipeline. + /// + /// + /// Thrown when a required parameter is null + /// + protected WeatherClient(System.Uri baseUri, HttpClientHandler rootHandler, params DelegatingHandler[] handlers) : this(rootHandler, handlers) + { + if (baseUri == null) + { + throw new System.ArgumentNullException("baseUri"); + } + BaseUri = baseUri; + } + + /// + /// Initializes a new instance of the WeatherClient class. + /// + /// + /// Required. Subscription credentials which uniquely identify client subscription. + /// + /// + /// Optional. The delegating handlers to add to the http client pipeline. + /// + /// + /// Thrown when a required parameter is null + /// + public WeatherClient(ServiceClientCredentials credentials, params DelegatingHandler[] handlers) : this(handlers) + { + if (credentials == null) + { + throw new System.ArgumentNullException("credentials"); + } + Credentials = credentials; + if (Credentials != null) + { + Credentials.InitializeServiceClient(this); + } + } + + /// + /// Initializes a new instance of the WeatherClient class. + /// + /// + /// Required. Subscription credentials which uniquely identify client subscription. + /// + /// + /// HttpClient to be used + /// + /// + /// True: will dispose the provided httpClient on calling WeatherClient.Dispose(). False: will not dispose provided httpClient + /// + /// Thrown when a required parameter is null + /// + public WeatherClient(ServiceClientCredentials credentials, HttpClient httpClient, bool disposeHttpClient) : this(httpClient, disposeHttpClient) + { + if (credentials == null) + { + throw new System.ArgumentNullException("credentials"); + } + Credentials = credentials; + if (Credentials != null) + { + Credentials.InitializeServiceClient(this); + } + } + + /// + /// Initializes a new instance of the WeatherClient class. + /// + /// + /// Required. Subscription credentials which uniquely identify client subscription. + /// + /// + /// Optional. The http client handler used to handle http transport. + /// + /// + /// Optional. The delegating handlers to add to the http client pipeline. + /// + /// + /// Thrown when a required parameter is null + /// + public WeatherClient(ServiceClientCredentials credentials, HttpClientHandler rootHandler, params DelegatingHandler[] handlers) : this(rootHandler, handlers) + { + if (credentials == null) + { + throw new System.ArgumentNullException("credentials"); + } + Credentials = credentials; + if (Credentials != null) + { + Credentials.InitializeServiceClient(this); + } + } + + /// + /// Initializes a new instance of the WeatherClient class. + /// + /// + /// Optional. The base URI of the service. + /// + /// + /// Required. Subscription credentials which uniquely identify client subscription. + /// + /// + /// Optional. The delegating handlers to add to the http client pipeline. + /// + /// + /// Thrown when a required parameter is null + /// + public WeatherClient(System.Uri baseUri, ServiceClientCredentials credentials, params DelegatingHandler[] handlers) : this(handlers) + { + if (baseUri == null) + { + throw new System.ArgumentNullException("baseUri"); + } + if (credentials == null) + { + throw new System.ArgumentNullException("credentials"); + } + BaseUri = baseUri; + Credentials = credentials; + if (Credentials != null) + { + Credentials.InitializeServiceClient(this); + } + } + + /// + /// Initializes a new instance of the WeatherClient class. + /// + /// + /// Optional. The base URI of the service. + /// + /// + /// Required. Subscription credentials which uniquely identify client subscription. + /// + /// + /// Optional. The http client handler used to handle http transport. + /// + /// + /// Optional. The delegating handlers to add to the http client pipeline. + /// + /// + /// Thrown when a required parameter is null + /// + public WeatherClient(System.Uri baseUri, ServiceClientCredentials credentials, HttpClientHandler rootHandler, params DelegatingHandler[] handlers) : this(rootHandler, handlers) + { + if (baseUri == null) + { + throw new System.ArgumentNullException("baseUri"); + } + if (credentials == null) + { + throw new System.ArgumentNullException("credentials"); + } + BaseUri = baseUri; + Credentials = credentials; + if (Credentials != null) + { + Credentials.InitializeServiceClient(this); + } + } + + /// + /// An optional partial-method to perform custom initialization. + /// + partial void CustomInitialize(); + /// + /// Initializes client properties. + /// + private void Initialize() + { + Weather = new WeatherOperations(this); + BaseUri = new System.Uri("https://atlas.microsoft.com"); + SerializationSettings = new JsonSerializerSettings + { + Formatting = Newtonsoft.Json.Formatting.Indented, + DateFormatHandling = Newtonsoft.Json.DateFormatHandling.IsoDateFormat, + DateTimeZoneHandling = Newtonsoft.Json.DateTimeZoneHandling.Utc, + NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore, + ReferenceLoopHandling = Newtonsoft.Json.ReferenceLoopHandling.Serialize, + ContractResolver = new ReadOnlyJsonContractResolver(), + Converters = new List + { + new Iso8601TimeSpanConverter() + } + }; + DeserializationSettings = new JsonSerializerSettings + { + DateFormatHandling = Newtonsoft.Json.DateFormatHandling.IsoDateFormat, + DateTimeZoneHandling = Newtonsoft.Json.DateTimeZoneHandling.Utc, + NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore, + ReferenceLoopHandling = Newtonsoft.Json.ReferenceLoopHandling.Serialize, + ContractResolver = new ReadOnlyJsonContractResolver(), + Converters = new List + { + new Iso8601TimeSpanConverter() + } + }; + SerializationSettings.Converters.Add(new PolymorphicSerializeJsonConverter("type")); + DeserializationSettings.Converters.Add(new PolymorphicDeserializeJsonConverter("type")); + CustomInitialize(); + } + } +} diff --git a/sdk/maps/Azure.Maps.Weather/src/Generated/WeatherOperations.cs b/sdk/maps/Azure.Maps.Weather/src/Generated/WeatherOperations.cs new file mode 100644 index 000000000000..de58fc218fd1 --- /dev/null +++ b/sdk/maps/Azure.Maps.Weather/src/Generated/WeatherOperations.cs @@ -0,0 +1,4105 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Azure.Maps.Weather +{ + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Models; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.IO; + using System.Linq; + using System.Net; + using System.Net.Http; + using System.Threading; + using System.Threading.Tasks; + + /// + /// WeatherOperations operations. + /// + public partial class WeatherOperations : IServiceOperations, IWeatherOperations + { + /// + /// Initializes a new instance of the WeatherOperations class. + /// + /// + /// Reference to the service client. + /// + /// + /// Thrown when a required parameter is null + /// + public WeatherOperations(WeatherClient client) + { + if (client == null) + { + throw new System.ArgumentNullException("client"); + } + Client = client; + } + + /// + /// Gets a reference to the WeatherClient + /// + public WeatherClient Client { get; private set; } + + /// + /// **Get Hourly Forecast** + /// + /// **Applies to**: see pricing [tiers](https://aka.ms/AzureMapsPricingTier). + /// + /// Request detailed weather forecast by the hour for the next 1, 12, 24 (1 + /// day), 72 (3 days), 120 (5 days), and 240 hours (10 days) for the given the + /// given coordinate location. The API returns details such as temperature, + /// humidity, wind, precipitation, and ultraviolet (UV) index. + /// + /// In S0 you can request hourly forecast for the next 1, 12, 24 hours (1 day), + /// and 72 hours (3 days). In S1 you can also request hourly forecast for the + /// next 120 (5 days) and 240 hours (10 days). + /// + /// + /// The applicable query specified as a comma separated string composed by + /// latitude followed by longitude e.g. "47.641268,-122.125679". + /// + /// + /// Specifies to return the data in either metric units or imperial units. + /// Default value is metric. Possible values include: 'metric', 'imperial' + /// + /// + /// Time frame of the returned weather forecast. By default, the forecast data + /// for next hour will be returned. Available values are + /// * `1` - Return forecast data for the next hour. Default value. + /// * `12` - Return hourly forecast for next 12 hours. + /// * `24` - Return hourly forecast for next 24 hours. + /// * `72` - Return hourly forecast for next 72 hours (3 days). + /// * `120` - Return hourly forecast for next 120 hours (5 days). Only + /// available in S1 SKU. + /// * `240` - Return hourly forecast for next 240 hours (10 days). Only + /// available in S1 SKU. + /// + /// + /// Language in which search results should be returned. Should be one of + /// supported IETF language tags, case insensitive. When data in specified + /// language is not available for a specific field, default language is used. + /// + /// Please refer to [Supported + /// Languages](https://docs.microsoft.com/azure/azure-maps/supported-languages) + /// for details. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task> GetHourlyForecastWithHttpMessagesAsync(IList coordinates, string unit = default(string), int? duration = default(int?), string language = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (coordinates == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "coordinates"); + } + if (coordinates != null) + { + if (coordinates.Count > 2) + { + throw new ValidationException(ValidationRules.MaxItems, "coordinates", 2); + } + if (coordinates.Count < 2) + { + throw new ValidationException(ValidationRules.MinItems, "coordinates", 2); + } + } + string format = "json"; + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("format", format); + tracingParameters.Add("coordinates", coordinates); + tracingParameters.Add("unit", unit); + tracingParameters.Add("duration", duration); + tracingParameters.Add("language", language); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "GetHourlyForecast", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "weather/forecast/hourly/{format}").ToString(); + _url = _url.Replace("{format}", System.Uri.EscapeDataString(format)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (coordinates != null) + { + _queryParameters.Add(string.Format("query={0}", System.Uri.EscapeDataString(string.Join(",", coordinates)))); + } + if (unit != null) + { + _queryParameters.Add(string.Format("unit={0}", System.Uri.EscapeDataString(unit))); + } + if (duration != null) + { + _queryParameters.Add(string.Format("duration={0}", System.Uri.EscapeDataString(SafeJsonConvert.SerializeObject(duration, Client.SerializationSettings).Trim('"')))); + } + if (language != null) + { + _queryParameters.Add(string.Format("language={0}", System.Uri.EscapeDataString(language))); + } + if (_queryParameters.Count > 0) + { + _url += "?" + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.ClientId != null) + { + if (_httpRequest.Headers.Contains("x-ms-client-id")) + { + _httpRequest.Headers.Remove("x-ms-client-id"); + } + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-id", Client.ClientId); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + ErrorResponse _errorBody = SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new HttpOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// **Get Minute Forecast** + /// + /// + /// **Applies to**: see pricing [tiers](https://aka.ms/AzureMapsPricingTier). + /// + /// + /// Get Minute Forecast service returns minute-by-minute forecasts for a given + /// location for the next 120 minutes. Users can request weather forecasts in + /// the interval of 1, 5 and 15 minutes. The response will include details + /// such as the type of precipitation (including rain, snow, or a mixture of + /// both), start time, and precipitation intensity value (dBZ). + /// + /// + /// The applicable query specified as a comma separated string composed by + /// latitude followed by longitude e.g. "47.641268,-122.125679". + /// + /// + /// Specifies time interval in minutes for the returned weather forecast. + /// Supported values are + /// * `1` - Retrieve forecast for 1-minute intervals. Returned by default. + /// * `5` - Retrieve forecasts for 5-minute intervals. + /// * `15` - Retrieve forecasts for 15-minute intervals. + /// + /// + /// Language in which search results should be returned. Should be one of + /// supported IETF language tags, case insensitive. When data in specified + /// language is not available for a specific field, default language is used. + /// + /// Please refer to [Supported + /// Languages](https://docs.microsoft.com/azure/azure-maps/supported-languages) + /// for details. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task> GetMinuteForecastWithHttpMessagesAsync(IList coordinates, int? interval = default(int?), string language = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (coordinates == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "coordinates"); + } + if (coordinates != null) + { + if (coordinates.Count > 2) + { + throw new ValidationException(ValidationRules.MaxItems, "coordinates", 2); + } + if (coordinates.Count < 2) + { + throw new ValidationException(ValidationRules.MinItems, "coordinates", 2); + } + } + string format = "json"; + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("format", format); + tracingParameters.Add("coordinates", coordinates); + tracingParameters.Add("interval", interval); + tracingParameters.Add("language", language); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "GetMinuteForecast", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "weather/forecast/minute/{format}").ToString(); + _url = _url.Replace("{format}", System.Uri.EscapeDataString(format)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (coordinates != null) + { + _queryParameters.Add(string.Format("query={0}", System.Uri.EscapeDataString(string.Join(",", coordinates)))); + } + if (interval != null) + { + _queryParameters.Add(string.Format("interval={0}", System.Uri.EscapeDataString(SafeJsonConvert.SerializeObject(interval, Client.SerializationSettings).Trim('"')))); + } + if (language != null) + { + _queryParameters.Add(string.Format("language={0}", System.Uri.EscapeDataString(language))); + } + if (_queryParameters.Count > 0) + { + _url += "?" + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.ClientId != null) + { + if (_httpRequest.Headers.Contains("x-ms-client-id")) + { + _httpRequest.Headers.Remove("x-ms-client-id"); + } + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-id", Client.ClientId); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + ErrorResponse _errorBody = SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new HttpOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// **Get Quarter-Day Forecast** + /// + /// + /// **Applies to**: see pricing [tiers](https://aka.ms/AzureMapsPricingTier). + /// + /// + /// Service returns detailed weather forecast by quarter-day for the next 1, 5, + /// 10, or 15 days for a given location. Response data is presented by quarters + /// of the day - morning, afternoon, evening, and overnight. Details such as + /// temperature, humidity, wind, precipitation, and UV index are returned. + /// + /// + /// The applicable query specified as a comma separated string composed by + /// latitude followed by longitude e.g. "47.641268,-122.125679". + /// + /// + /// Specifies to return the data in either metric units or imperial units. + /// Default value is metric. Possible values include: 'metric', 'imperial' + /// + /// + /// Specifies for how many days the quester-day forecast responses are + /// returned. Supported values are: + /// * `1` - Return forecast data for the next day. Returned by default. + /// * `5` - Return forecast data for the next 5 days. + /// * `10` - Return forecast data for next 10 days. + /// * `15` - Return forecast data for the next 15 days. + /// + /// + /// Language in which search results should be returned. Should be one of + /// supported IETF language tags, case insensitive. When data in specified + /// language is not available for a specific field, default language is used. + /// + /// Please refer to [Supported + /// Languages](https://docs.microsoft.com/azure/azure-maps/supported-languages) + /// for details. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task> GetQuarterDayForecastWithHttpMessagesAsync(IList coordinates, string unit = default(string), int? duration = default(int?), string language = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (coordinates == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "coordinates"); + } + if (coordinates != null) + { + if (coordinates.Count > 2) + { + throw new ValidationException(ValidationRules.MaxItems, "coordinates", 2); + } + if (coordinates.Count < 2) + { + throw new ValidationException(ValidationRules.MinItems, "coordinates", 2); + } + } + string format = "json"; + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("format", format); + tracingParameters.Add("coordinates", coordinates); + tracingParameters.Add("unit", unit); + tracingParameters.Add("duration", duration); + tracingParameters.Add("language", language); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "GetQuarterDayForecast", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "weather/forecast/quarterDay/{format}").ToString(); + _url = _url.Replace("{format}", System.Uri.EscapeDataString(format)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (coordinates != null) + { + _queryParameters.Add(string.Format("query={0}", System.Uri.EscapeDataString(string.Join(",", coordinates)))); + } + if (unit != null) + { + _queryParameters.Add(string.Format("unit={0}", System.Uri.EscapeDataString(unit))); + } + if (duration != null) + { + _queryParameters.Add(string.Format("duration={0}", System.Uri.EscapeDataString(SafeJsonConvert.SerializeObject(duration, Client.SerializationSettings).Trim('"')))); + } + if (language != null) + { + _queryParameters.Add(string.Format("language={0}", System.Uri.EscapeDataString(language))); + } + if (_queryParameters.Count > 0) + { + _url += "?" + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.ClientId != null) + { + if (_httpRequest.Headers.Contains("x-ms-client-id")) + { + _httpRequest.Headers.Remove("x-ms-client-id"); + } + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-id", Client.ClientId); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + ErrorResponse _errorBody = SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new HttpOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// **Get Current Conditions** + /// + /// + /// **Applies to**: see pricing [tiers](https://aka.ms/AzureMapsPricingTier). + /// + /// + /// Get Current Conditions service returns detailed current weather conditions + /// such as precipitation, temperature and wind for a given coordinate + /// location. Also, observations from the past 6 or 24 hours for a particular + /// location can be retrieved. The basic information returned with the response + /// include details such as observation date and time, brief description of the + /// weather conditions, weather icon, precipitation indicator flags, and + /// temperature. Additional details such as RealFeel™ Temperature and UV index + /// are also returned. + /// + /// + /// The applicable query specified as a comma separated string composed by + /// latitude followed by longitude e.g. "47.641268,-122.125679". + /// + /// + /// Specifies to return the data in either metric units or imperial units. + /// Default value is metric. Possible values include: 'metric', 'imperial' + /// + /// + /// Return full details for the current conditions. Available values are + /// * `true` - Returns full details. By default all details are returned. + /// * `false` - Returns a truncated version of the current condition data, + /// which includes observation date time, weather phrase, icon code, + /// precipitation indicator flag, and temperature. + /// + /// + /// Time frame of the returned weather conditions. By default, the most current + /// weather conditions will be returned. Default value is 0. Supported values + /// are: + /// * `0` - Return the most current weather conditions. + /// * `6` - Return weather conditions from past 6 hours. + /// * `24` - Return weather conditions from past 24 hours. + /// + /// + /// Language in which search results should be returned. Should be one of + /// supported IETF language tags, case insensitive. When data in specified + /// language is not available for a specific field, default language is used. + /// + /// Please refer to [Supported + /// Languages](https://docs.microsoft.com/azure/azure-maps/supported-languages) + /// for details. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task> GetCurrentConditionsWithHttpMessagesAsync(IList coordinates, string unit = default(string), string details = default(string), int? duration = default(int?), string language = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (coordinates == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "coordinates"); + } + if (coordinates != null) + { + if (coordinates.Count > 2) + { + throw new ValidationException(ValidationRules.MaxItems, "coordinates", 2); + } + if (coordinates.Count < 2) + { + throw new ValidationException(ValidationRules.MinItems, "coordinates", 2); + } + } + string format = "json"; + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("format", format); + tracingParameters.Add("coordinates", coordinates); + tracingParameters.Add("unit", unit); + tracingParameters.Add("details", details); + tracingParameters.Add("duration", duration); + tracingParameters.Add("language", language); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "GetCurrentConditions", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "weather/currentConditions/{format}").ToString(); + _url = _url.Replace("{format}", System.Uri.EscapeDataString(format)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (coordinates != null) + { + _queryParameters.Add(string.Format("query={0}", System.Uri.EscapeDataString(string.Join(",", coordinates)))); + } + if (unit != null) + { + _queryParameters.Add(string.Format("unit={0}", System.Uri.EscapeDataString(unit))); + } + if (details != null) + { + _queryParameters.Add(string.Format("details={0}", System.Uri.EscapeDataString(details))); + } + if (duration != null) + { + _queryParameters.Add(string.Format("duration={0}", System.Uri.EscapeDataString(SafeJsonConvert.SerializeObject(duration, Client.SerializationSettings).Trim('"')))); + } + if (language != null) + { + _queryParameters.Add(string.Format("language={0}", System.Uri.EscapeDataString(language))); + } + if (_queryParameters.Count > 0) + { + _url += "?" + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.ClientId != null) + { + if (_httpRequest.Headers.Contains("x-ms-client-id")) + { + _httpRequest.Headers.Remove("x-ms-client-id"); + } + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-id", Client.ClientId); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + ErrorResponse _errorBody = SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new HttpOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// **Get Daily Forecast** + /// + /// + /// **Applies to**: see pricing [tiers](https://aka.ms/AzureMapsPricingTier). + /// + /// + /// The service returns detailed weather forecast such as temperature and wind + /// by day for the next 1, 5, 10, 15, 25, or 45 days for a given coordinate + /// location. The response include details such as temperature, wind, + /// precipitation, air quality, and UV index. + /// + /// In S0 you can request daily forecast for the next 1, 5, 10, and 15 days. In + /// S1 you can also request daily forecast for the next 25 days, and 45 days. + /// + /// + /// The applicable query specified as a comma separated string composed by + /// latitude followed by longitude e.g. "47.641268,-122.125679". + /// + /// + /// Specifies to return the data in either metric units or imperial units. + /// Default value is metric. Possible values include: 'metric', 'imperial' + /// + /// + /// Specifies for how many days the daily forecast responses are returned. + /// Available values are + /// * `1` - Return forecast data for the next day. Returned by default. + /// * `5` - Return forecast data for the next 5 days. + /// * `10` - Return forecast data for the next 10 days. + /// * `25` - Return forecast data for the next 25 days. Only available in S1 + /// SKU. + /// * `45` - Return forecast data for the next 45 days. Only available in S1 + /// SKU. + /// + /// + /// Language in which search results should be returned. Should be one of + /// supported IETF language tags, case insensitive. When data in specified + /// language is not available for a specific field, default language is used. + /// + /// Please refer to [Supported + /// Languages](https://docs.microsoft.com/azure/azure-maps/supported-languages) + /// for details. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task> GetDailyForecastWithHttpMessagesAsync(IList coordinates, string unit = default(string), int? duration = default(int?), string language = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (coordinates == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "coordinates"); + } + if (coordinates != null) + { + if (coordinates.Count > 2) + { + throw new ValidationException(ValidationRules.MaxItems, "coordinates", 2); + } + if (coordinates.Count < 2) + { + throw new ValidationException(ValidationRules.MinItems, "coordinates", 2); + } + } + string format = "json"; + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("format", format); + tracingParameters.Add("coordinates", coordinates); + tracingParameters.Add("unit", unit); + tracingParameters.Add("duration", duration); + tracingParameters.Add("language", language); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "GetDailyForecast", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "weather/forecast/daily/{format}").ToString(); + _url = _url.Replace("{format}", System.Uri.EscapeDataString(format)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (coordinates != null) + { + _queryParameters.Add(string.Format("query={0}", System.Uri.EscapeDataString(string.Join(",", coordinates)))); + } + if (unit != null) + { + _queryParameters.Add(string.Format("unit={0}", System.Uri.EscapeDataString(unit))); + } + if (duration != null) + { + _queryParameters.Add(string.Format("duration={0}", System.Uri.EscapeDataString(SafeJsonConvert.SerializeObject(duration, Client.SerializationSettings).Trim('"')))); + } + if (language != null) + { + _queryParameters.Add(string.Format("language={0}", System.Uri.EscapeDataString(language))); + } + if (_queryParameters.Count > 0) + { + _url += "?" + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.ClientId != null) + { + if (_httpRequest.Headers.Contains("x-ms-client-id")) + { + _httpRequest.Headers.Remove("x-ms-client-id"); + } + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-id", Client.ClientId); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + ErrorResponse _errorBody = SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new HttpOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// **Get Weather along route** + /// + /// + /// **Applies to**: see pricing [tiers](https://aka.ms/AzureMapsPricingTier). + /// + /// Weather along a route API returns hyper local (one kilometer or less), + /// up-to-the-minute weather nowcasts, weather hazard assessments, and + /// notifications along a route described as a sequence of waypoints. + /// This includes a list of weather hazards affecting the waypoint or route, + /// and the aggregated hazard index for each waypoint might be used to paint + /// each portion of a route according to how safe it is for the driver. When + /// submitting the waypoints, it is recommended to stay within, or close to, + /// the distance that can be traveled within 120-mins or shortly after. Data is + /// updated every five minutes. + /// + /// The service supplements Azure Maps [Route + /// Service](https://docs.microsoft.com/rest/api/maps/route) that allows you to + /// first request a route between an origin and a destination and use that as + /// an input for Weather Along Route endpoint. + /// + /// In addition, the service supports scenarios to generate weather + /// notifications for waypoints that experience an increase in intensity of a + /// weather hazard. For example, if the vehicle is expected to begin + /// experiencing heavy rain as it reaches a waypoint, a weather notification + /// for heavy rain will be generated for that waypoint allowing the end product + /// to display a heavy rain notification before the driver reaches that + /// waypoint. + /// The trigger for when to display the notification for a waypoint could be + /// based, for example, on a + /// [geofence](https://docs.microsoft.com/azure/azure-maps/tutorial-iot-hub-maps), + /// or selectable distance to the waypoint. + /// + /// The API covers all regions of the planet except latitudes above Greenland + /// and Antarctica. + /// + /// + /// Coordinates through which the route is calculated, separated by colon (:) + /// and entered in chronological order. A minimum of two waypoints is required. + /// A single API call may contain up to 60 waypoints. + /// A waypoint indicates location, ETA, and optional heading: + /// latitude,longitude,ETA,heading, where + /// * `Latitude` - Latitude coordinate in decimal degrees. + /// * `Longitude` - Longitude coordinate in decimal degrees. + /// * `ETA (estimated time of arrival)` - The number of minutes from the + /// present time that it will take for the vehicle to reach the waypoint. + /// Allowed range is from 0.0 to 120.0 minutes. + /// * `Heading` - An optional value indicating the vehicle heading as it passes + /// the waypoint. Expressed in clockwise degrees relative to true north. This + /// is issued to calculate sun glare as a driving hazard. Allowed range is from + /// 0.0 to 360.0 degrees. If not provided, a heading will automatically be + /// derived based on the position of neighboring waypoints. + /// + /// It is recommended to stay within, or close to, the distance that can be + /// traveled within 120-mins or shortly after. This way a more accurate + /// assessment can be provided for the trip and prevent isolated events not + /// being captured between waypoints. Information can and should be updated + /// along the route (especially for trips greater than 2 hours) to continuously + /// pull new waypoints moving forward, but also to ensure that forecast + /// information for content such as precipitation type and intensity is + /// accurate as storms develop and dissipate over time. + /// + /// + /// Language in which search results should be returned. Should be one of + /// supported IETF language tags, case insensitive. When data in specified + /// language is not available for a specific field, default language is used. + /// + /// Please refer to [Supported + /// Languages](https://docs.microsoft.com/azure/azure-maps/supported-languages) + /// for details. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task> GetWeatherAlongRouteWithHttpMessagesAsync(string query, string language = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (query == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "query"); + } + string format = "json"; + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("format", format); + tracingParameters.Add("query", query); + tracingParameters.Add("language", language); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "GetWeatherAlongRoute", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "weather/route/{format}").ToString(); + _url = _url.Replace("{format}", System.Uri.EscapeDataString(format)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (query != null) + { + _queryParameters.Add(string.Format("query={0}", System.Uri.EscapeDataString(query))); + } + if (language != null) + { + _queryParameters.Add(string.Format("language={0}", System.Uri.EscapeDataString(language))); + } + if (_queryParameters.Count > 0) + { + _url += "?" + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.ClientId != null) + { + if (_httpRequest.Headers.Contains("x-ms-client-id")) + { + _httpRequest.Headers.Remove("x-ms-client-id"); + } + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-id", Client.ClientId); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + ErrorResponse _errorBody = SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new HttpOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// **Get Severe Weather Alerts** + /// + /// **Applies to**: see pricing [tiers](https://aka.ms/AzureMapsPricingTier). + /// + /// Severe weather phenomenon can significantly impact our everyday life and + /// business operations. For example, severe weather conditions such as + /// tropical storms, high winds or flooding can close roads and force logistics + /// companies to reroute their fleet causing delays in reaching destinations + /// and breaking the cold chain of refrigerated food products.  Azure Maps + /// Severe Weather Alerts API returns the severe weather alerts that are + /// available worldwide from both official Government Meteorological Agencies + /// and leading global to regional weather alert providers. The service can + /// return details such as alert type, category, level and detailed description + /// about the active severe alerts for the requested location, like hurricanes, + /// thunderstorms, lightning, heat waves or forest fires. + /// + /// + /// The applicable query specified as a comma separated string composed by + /// latitude followed by longitude e.g. "47.641268,-122.125679". + /// + /// + /// Language in which search results should be returned. Should be one of + /// supported IETF language tags, case insensitive. When data in specified + /// language is not available for a specific field, default language is used. + /// + /// Please refer to [Supported + /// Languages](https://docs.microsoft.com/azure/azure-maps/supported-languages) + /// for details. + /// + /// + /// Return full details for the severe weather alerts. Available values are + /// * `true` - Returns full details. By default all details are returned. + /// * `false` - Returns a truncated version of the alerts data, which excludes + /// the area-specific full description of alert details (`alertDetails`). + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task> GetSevereWeatherAlertsWithHttpMessagesAsync(IList coordinates, string language = default(string), string details = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (coordinates == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "coordinates"); + } + if (coordinates != null) + { + if (coordinates.Count > 2) + { + throw new ValidationException(ValidationRules.MaxItems, "coordinates", 2); + } + if (coordinates.Count < 2) + { + throw new ValidationException(ValidationRules.MinItems, "coordinates", 2); + } + } + string format = "json"; + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("format", format); + tracingParameters.Add("coordinates", coordinates); + tracingParameters.Add("language", language); + tracingParameters.Add("details", details); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "GetSevereWeatherAlerts", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "weather/severe/alerts/{format}").ToString(); + _url = _url.Replace("{format}", System.Uri.EscapeDataString(format)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (coordinates != null) + { + _queryParameters.Add(string.Format("query={0}", System.Uri.EscapeDataString(string.Join(",", coordinates)))); + } + if (language != null) + { + _queryParameters.Add(string.Format("language={0}", System.Uri.EscapeDataString(language))); + } + if (details != null) + { + _queryParameters.Add(string.Format("details={0}", System.Uri.EscapeDataString(details))); + } + if (_queryParameters.Count > 0) + { + _url += "?" + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.ClientId != null) + { + if (_httpRequest.Headers.Contains("x-ms-client-id")) + { + _httpRequest.Headers.Remove("x-ms-client-id"); + } + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-id", Client.ClientId); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + ErrorResponse _errorBody = SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new HttpOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// **Get Daily Indices** + /// + /// **Applies to**: see pricing [tiers](https://aka.ms/AzureMapsPricingTier). + /// + /// There may be times when you want to know if the weather conditions are + /// optimal for a specific activity, for example, for outdoor construction, + /// indoor activities, running or farming including soil moisture information. + /// Azure Maps Indices API returns index values that will guide end users to + /// plan future activities. For example, a health mobile application can notify + /// users that today is good weather for running or for other outdoors + /// activities like for playing golf, and retail stores can optimize their + /// digital marketing campaigns based on predicted index values. The service + /// returns in daily indices values for current and next 5, 10 and 15 days + /// starting from current day. + /// + /// + /// The applicable query specified as a comma separated string composed by + /// latitude followed by longitude e.g. "47.641268,-122.125679". + /// + /// + /// Language in which search results should be returned. Should be one of + /// supported IETF language tags, case insensitive. When data in specified + /// language is not available for a specific field, default language is used. + /// + /// Please refer to [Supported + /// Languages](https://docs.microsoft.com/azure/azure-maps/supported-languages) + /// for details. + /// + /// + /// Specifies for how many days the daily indices are returned. By default, the + /// indices data for the current day will be returned. When requesting future + /// indices data, the current day is included in the response as day 1. + /// Available values are + /// * `1` - Return daily index data for the current day. Default value. + /// * `5` - Return 5 days of daily index data starting from the current day. + /// * `10` - Return 10 days of daily index data starting from the current day. + /// * `15` - Return 15 days of daily index data starting from the current day. + /// + /// + /// Numeric index identifier that can be used for restricting returned results + /// to the corresponding index type. Cannot be paired with `indexGroupId`. + /// Please refer to [Weather Service + /// Concepts](https://aka.ms/AzureMapsWeatherConcepts) for details and to see + /// the supported indices. + /// + /// + /// Numeric index group identifier that can be used for restricting returned + /// results to the corresponding subset of indices (index group). Cannot be + /// paired with `indexId`. Please refer to [Weather Service + /// Concepts](https://aka.ms/AzureMapsWeatherConcepts) for details and to see + /// the supported index groups. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task> GetDailyIndicesWithHttpMessagesAsync(IList coordinates, string language = default(string), int? duration = default(int?), int? indexId = default(int?), int? indexGroupId = default(int?), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (coordinates == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "coordinates"); + } + if (coordinates != null) + { + if (coordinates.Count > 2) + { + throw new ValidationException(ValidationRules.MaxItems, "coordinates", 2); + } + if (coordinates.Count < 2) + { + throw new ValidationException(ValidationRules.MinItems, "coordinates", 2); + } + } + string format = "json"; + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("format", format); + tracingParameters.Add("coordinates", coordinates); + tracingParameters.Add("language", language); + tracingParameters.Add("duration", duration); + tracingParameters.Add("indexId", indexId); + tracingParameters.Add("indexGroupId", indexGroupId); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "GetDailyIndices", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "weather/indices/daily/{format}").ToString(); + _url = _url.Replace("{format}", System.Uri.EscapeDataString(format)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (coordinates != null) + { + _queryParameters.Add(string.Format("query={0}", System.Uri.EscapeDataString(string.Join(",", coordinates)))); + } + if (language != null) + { + _queryParameters.Add(string.Format("language={0}", System.Uri.EscapeDataString(language))); + } + if (duration != null) + { + _queryParameters.Add(string.Format("duration={0}", System.Uri.EscapeDataString(SafeJsonConvert.SerializeObject(duration, Client.SerializationSettings).Trim('"')))); + } + if (indexId != null) + { + _queryParameters.Add(string.Format("indexId={0}", System.Uri.EscapeDataString(SafeJsonConvert.SerializeObject(indexId, Client.SerializationSettings).Trim('"')))); + } + if (indexGroupId != null) + { + _queryParameters.Add(string.Format("indexGroupId={0}", System.Uri.EscapeDataString(SafeJsonConvert.SerializeObject(indexGroupId, Client.SerializationSettings).Trim('"')))); + } + if (_queryParameters.Count > 0) + { + _url += "?" + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.ClientId != null) + { + if (_httpRequest.Headers.Contains("x-ms-client-id")) + { + _httpRequest.Headers.Remove("x-ms-client-id"); + } + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-id", Client.ClientId); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + ErrorResponse _errorBody = SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new HttpOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// **Get Tropical Storm Active** + /// + /// **Applies to**: see pricing [tiers](https://aka.ms/AzureMapsPricingTier). + /// + /// Get all government-issued active tropical storms. Information about the + /// tropical storms includes, government ID, basin ID, year of origin, name and + /// if it is subtropical. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task> GetTropicalStormActiveWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + string format = "json"; + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("format", format); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "GetTropicalStormActive", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "weather/tropical/storms/active/{format}").ToString(); + _url = _url.Replace("{format}", System.Uri.EscapeDataString(format)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += "?" + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.ClientId != null) + { + if (_httpRequest.Headers.Contains("x-ms-client-id")) + { + _httpRequest.Headers.Remove("x-ms-client-id"); + } + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-id", Client.ClientId); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + ErrorResponse _errorBody = SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new HttpOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// **Get Tropical Storm Search** + /// + /// **Applies to**: see pricing [tiers](https://aka.ms/AzureMapsPricingTier). + /// + /// Search government-issued tropical storms by year, basin ID, and government + /// ID. Information about the tropical storms includes, government ID, basin + /// ID, status, year, name and if it is subtropical. + /// + /// + /// Year of the cyclone(s) + /// + /// + /// Basin identifier. Possible values include: 'AL', 'EP', 'SI', 'NI', 'CP', + /// 'NP', 'SP' + /// + /// + /// Government storm Id + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task> GetTropicalStormSearchWithHttpMessagesAsync(int year, string basinId = default(string), int? governmentStormId = default(int?), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + string format = "json"; + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("format", format); + tracingParameters.Add("year", year); + tracingParameters.Add("basinId", basinId); + tracingParameters.Add("governmentStormId", governmentStormId); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "GetTropicalStormSearch", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "weather/tropical/storms/{format}").ToString(); + _url = _url.Replace("{format}", System.Uri.EscapeDataString(format)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + _queryParameters.Add(string.Format("year={0}", System.Uri.EscapeDataString(SafeJsonConvert.SerializeObject(year, Client.SerializationSettings).Trim('"')))); + if (basinId != null) + { + _queryParameters.Add(string.Format("basinId={0}", System.Uri.EscapeDataString(basinId))); + } + if (governmentStormId != null) + { + _queryParameters.Add(string.Format("govId={0}", System.Uri.EscapeDataString(SafeJsonConvert.SerializeObject(governmentStormId, Client.SerializationSettings).Trim('"')))); + } + if (_queryParameters.Count > 0) + { + _url += "?" + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.ClientId != null) + { + if (_httpRequest.Headers.Contains("x-ms-client-id")) + { + _httpRequest.Headers.Remove("x-ms-client-id"); + } + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-id", Client.ClientId); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + ErrorResponse _errorBody = SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new HttpOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// **Get Tropical Storm Forecasts** + /// + /// **Applies to**: see pricing [tiers](https://aka.ms/AzureMapsPricingTier). + /// + /// Get individual government-issued tropical storm forecasts. Information + /// about the forecasted tropical storms includes, location, status, date the + /// forecast was created, window, wind speed and wind radii. + /// + /// + /// Year of the cyclone(s) + /// + /// + /// Basin identifier. Possible values include: 'AL', 'EP', 'SI', 'NI', 'CP', + /// 'NP', 'SP' + /// + /// + /// Government storm Id + /// + /// + /// Specifies to return the data in either metric units or imperial units. + /// Default value is metric. Possible values include: 'metric', 'imperial' + /// + /// + /// When true, wind radii summary data is included in the response + /// + /// + /// When true, wind radii summary data and geoJSON details are included in the + /// response + /// + /// + /// When true, window geometry data (geoJSON) is included in the response + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task> GetTropicalStormForecastWithHttpMessagesAsync(int year, string basinId, int governmentStormId, string unit = default(string), bool? includeDetails = false, bool? includeGeometricDetails = false, bool? includeWindowGeometry = false, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (basinId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "basinId"); + } + string format = "json"; + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("format", format); + tracingParameters.Add("year", year); + tracingParameters.Add("basinId", basinId); + tracingParameters.Add("governmentStormId", governmentStormId); + tracingParameters.Add("unit", unit); + tracingParameters.Add("includeDetails", includeDetails); + tracingParameters.Add("includeGeometricDetails", includeGeometricDetails); + tracingParameters.Add("includeWindowGeometry", includeWindowGeometry); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "GetTropicalStormForecast", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "weather/tropical/storms/forecasts/{format}").ToString(); + _url = _url.Replace("{format}", System.Uri.EscapeDataString(format)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + _queryParameters.Add(string.Format("year={0}", System.Uri.EscapeDataString(SafeJsonConvert.SerializeObject(year, Client.SerializationSettings).Trim('"')))); + if (basinId != null) + { + _queryParameters.Add(string.Format("basinId={0}", System.Uri.EscapeDataString(basinId))); + } + _queryParameters.Add(string.Format("govId={0}", System.Uri.EscapeDataString(SafeJsonConvert.SerializeObject(governmentStormId, Client.SerializationSettings).Trim('"')))); + if (unit != null) + { + _queryParameters.Add(string.Format("unit={0}", System.Uri.EscapeDataString(unit))); + } + if (includeDetails != null) + { + _queryParameters.Add(string.Format("details={0}", System.Uri.EscapeDataString(SafeJsonConvert.SerializeObject(includeDetails, Client.SerializationSettings).Trim('"')))); + } + if (includeGeometricDetails != null) + { + _queryParameters.Add(string.Format("radiiGeometry={0}", System.Uri.EscapeDataString(SafeJsonConvert.SerializeObject(includeGeometricDetails, Client.SerializationSettings).Trim('"')))); + } + if (includeWindowGeometry != null) + { + _queryParameters.Add(string.Format("windowGeometry={0}", System.Uri.EscapeDataString(SafeJsonConvert.SerializeObject(includeWindowGeometry, Client.SerializationSettings).Trim('"')))); + } + if (_queryParameters.Count > 0) + { + _url += "?" + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.ClientId != null) + { + if (_httpRequest.Headers.Contains("x-ms-client-id")) + { + _httpRequest.Headers.Remove("x-ms-client-id"); + } + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-id", Client.ClientId); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + ErrorResponse _errorBody = SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new HttpOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// **Get Tropical Storm Locations** + /// + /// **Applies to**: see pricing [tiers](https://aka.ms/AzureMapsPricingTier). + /// + /// Get location of individual government-issued tropical storms. Information + /// about the tropical storms includes, location coordinates, geometry, basin + /// ID, date, wind details and wind radii. + /// + /// + /// Year of the cyclone(s) + /// + /// + /// Basin identifier. Possible values include: 'AL', 'EP', 'SI', 'NI', 'CP', + /// 'NP', 'SP' + /// + /// + /// Government storm Id + /// + /// + /// When true, wind radii summary data is included in the response + /// + /// + /// When true, wind radii summary data and geoJSON details are included in the + /// response + /// + /// + /// Specifies to return the data in either metric units or imperial units. + /// Default value is metric. Possible values include: 'metric', 'imperial' + /// + /// + /// When true, return the current storm location + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task> GetTropicalStormLocationsWithHttpMessagesAsync(int year, string basinId, int governmentStormId, bool? includeDetails = false, bool? includeGeometricDetails = false, string unit = default(string), bool? includeCurrentStorm = false, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (basinId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "basinId"); + } + string format = "json"; + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("format", format); + tracingParameters.Add("year", year); + tracingParameters.Add("basinId", basinId); + tracingParameters.Add("governmentStormId", governmentStormId); + tracingParameters.Add("includeDetails", includeDetails); + tracingParameters.Add("includeGeometricDetails", includeGeometricDetails); + tracingParameters.Add("unit", unit); + tracingParameters.Add("includeCurrentStorm", includeCurrentStorm); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "GetTropicalStormLocations", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "weather/tropical/storms/locations/{format}").ToString(); + _url = _url.Replace("{format}", System.Uri.EscapeDataString(format)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + _queryParameters.Add(string.Format("year={0}", System.Uri.EscapeDataString(SafeJsonConvert.SerializeObject(year, Client.SerializationSettings).Trim('"')))); + if (basinId != null) + { + _queryParameters.Add(string.Format("basinId={0}", System.Uri.EscapeDataString(basinId))); + } + _queryParameters.Add(string.Format("govId={0}", System.Uri.EscapeDataString(SafeJsonConvert.SerializeObject(governmentStormId, Client.SerializationSettings).Trim('"')))); + if (includeDetails != null) + { + _queryParameters.Add(string.Format("details={0}", System.Uri.EscapeDataString(SafeJsonConvert.SerializeObject(includeDetails, Client.SerializationSettings).Trim('"')))); + } + if (includeGeometricDetails != null) + { + _queryParameters.Add(string.Format("radiiGeometry={0}", System.Uri.EscapeDataString(SafeJsonConvert.SerializeObject(includeGeometricDetails, Client.SerializationSettings).Trim('"')))); + } + if (unit != null) + { + _queryParameters.Add(string.Format("unit={0}", System.Uri.EscapeDataString(unit))); + } + if (includeCurrentStorm != null) + { + _queryParameters.Add(string.Format("current={0}", System.Uri.EscapeDataString(SafeJsonConvert.SerializeObject(includeCurrentStorm, Client.SerializationSettings).Trim('"')))); + } + if (_queryParameters.Count > 0) + { + _url += "?" + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.ClientId != null) + { + if (_httpRequest.Headers.Contains("x-ms-client-id")) + { + _httpRequest.Headers.Remove("x-ms-client-id"); + } + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-id", Client.ClientId); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + ErrorResponse _errorBody = SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new HttpOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// **Get Current Air Quality** + /// + /// **Applies to**: see pricing [tiers](https://aka.ms/AzureMapsPricingTier). + /// + /// Get detailed information about the concentration of pollutants and overall + /// status for current air quality. Information includes, pollution levels, air + /// quality index values, the dominant pollutant, and a brief statement + /// summarizing risk level and suggested precautions. + /// + /// + /// The applicable query specified as a comma separated string composed by + /// latitude followed by longitude e.g. "47.641268,-122.125679". + /// + /// + /// Language in which search results should be returned. Should be one of + /// supported IETF language tags, case insensitive. When data in specified + /// language is not available for a specific field, default language is used. + /// + /// Please refer to [Supported + /// Languages](https://docs.microsoft.com/azure/azure-maps/supported-languages) + /// for details. + /// + /// + /// Boolean value that returns detailed information about each pollutant. By + /// default is True. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task> GetCurrentAirQualityWithHttpMessagesAsync(IList coordinates, string language = default(string), bool? includePollutantDetails = default(bool?), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (coordinates == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "coordinates"); + } + if (coordinates != null) + { + if (coordinates.Count > 2) + { + throw new ValidationException(ValidationRules.MaxItems, "coordinates", 2); + } + if (coordinates.Count < 2) + { + throw new ValidationException(ValidationRules.MinItems, "coordinates", 2); + } + } + string format = "json"; + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("format", format); + tracingParameters.Add("language", language); + tracingParameters.Add("coordinates", coordinates); + tracingParameters.Add("includePollutantDetails", includePollutantDetails); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "GetCurrentAirQuality", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "weather/airQuality/current/{format}").ToString(); + _url = _url.Replace("{format}", System.Uri.EscapeDataString(format)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (language != null) + { + _queryParameters.Add(string.Format("language={0}", System.Uri.EscapeDataString(language))); + } + if (coordinates != null) + { + _queryParameters.Add(string.Format("query={0}", System.Uri.EscapeDataString(string.Join(",", coordinates)))); + } + if (includePollutantDetails != null) + { + _queryParameters.Add(string.Format("pollutants={0}", System.Uri.EscapeDataString(SafeJsonConvert.SerializeObject(includePollutantDetails, Client.SerializationSettings).Trim('"')))); + } + if (_queryParameters.Count > 0) + { + _url += "?" + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.ClientId != null) + { + if (_httpRequest.Headers.Contains("x-ms-client-id")) + { + _httpRequest.Headers.Remove("x-ms-client-id"); + } + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-id", Client.ClientId); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + ErrorResponse _errorBody = SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new HttpOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// **Get Air Quality Daily Forecasts** + /// + /// **Applies to**: see pricing [tiers](https://aka.ms/AzureMapsPricingTier). + /// + /// Get detailed information about the concentration of pollutants and overall + /// status of forecasted daily air quality. The service can provide forecasted + /// daily air quality information for the upcoming 1 to 7 days. Information + /// includes, pollution levels, air quality index values, the dominant + /// pollutant, and a brief statement summarizing risk level and suggested + /// precautions. + /// + /// + /// The applicable query specified as a comma separated string composed by + /// latitude followed by longitude e.g. "47.641268,-122.125679". + /// + /// + /// Language in which search results should be returned. Should be one of + /// supported IETF language tags, case insensitive. When data in specified + /// language is not available for a specific field, default language is used. + /// + /// Please refer to [Supported + /// Languages](https://docs.microsoft.com/azure/azure-maps/supported-languages) + /// for details. + /// + /// + /// Specifies for how many days from now we would like to know about the air + /// quality. Available values are 1, 2, 3, 4, 5, 6, and 7. Default value is 1. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task> GetAirQualityDailyForecastsWithHttpMessagesAsync(IList coordinates, string language = default(string), int? duration = 1, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (coordinates == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "coordinates"); + } + if (coordinates != null) + { + if (coordinates.Count > 2) + { + throw new ValidationException(ValidationRules.MaxItems, "coordinates", 2); + } + if (coordinates.Count < 2) + { + throw new ValidationException(ValidationRules.MinItems, "coordinates", 2); + } + } + string format = "json"; + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("format", format); + tracingParameters.Add("language", language); + tracingParameters.Add("coordinates", coordinates); + tracingParameters.Add("duration", duration); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "GetAirQualityDailyForecasts", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "weather/airQuality/forecasts/daily/{format}").ToString(); + _url = _url.Replace("{format}", System.Uri.EscapeDataString(format)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (language != null) + { + _queryParameters.Add(string.Format("language={0}", System.Uri.EscapeDataString(language))); + } + if (coordinates != null) + { + _queryParameters.Add(string.Format("query={0}", System.Uri.EscapeDataString(string.Join(",", coordinates)))); + } + if (duration != null) + { + _queryParameters.Add(string.Format("duration={0}", System.Uri.EscapeDataString(SafeJsonConvert.SerializeObject(duration, Client.SerializationSettings).Trim('"')))); + } + if (_queryParameters.Count > 0) + { + _url += "?" + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.ClientId != null) + { + if (_httpRequest.Headers.Contains("x-ms-client-id")) + { + _httpRequest.Headers.Remove("x-ms-client-id"); + } + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-id", Client.ClientId); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + ErrorResponse _errorBody = SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new HttpOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// **Get Air Quality Hourly Forecasts** + /// + /// **Applies to**: see pricing [tiers](https://aka.ms/AzureMapsPricingTier). + /// + /// Get detailed information about the concentration of pollutants and overall + /// status for forecasted upcoming hourly air quality. The service can provide + /// forecasted hourly air quality information for the upcoming time spans of 1, + /// 12, 24, 48, 72, and 96 hours. Information includes, pollution levels, air + /// quality index values, the dominant pollutant, and a brief statement + /// summarizing risk level and suggested precautions. + /// + /// + /// The applicable query specified as a comma separated string composed by + /// latitude followed by longitude e.g. "47.641268,-122.125679". + /// + /// + /// Language in which search results should be returned. Should be one of + /// supported IETF language tags, case insensitive. When data in specified + /// language is not available for a specific field, default language is used. + /// + /// Please refer to [Supported + /// Languages](https://docs.microsoft.com/azure/azure-maps/supported-languages) + /// for details. + /// + /// + /// Specifies for how many hours from now we would like to know about the air + /// quality. Available values are 1, 12, 24, 48, 72, 96. Default value is 1 + /// hour. + /// + /// + /// Boolean value that returns detailed information about each pollutant. By + /// default is True. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task> GetAirQualityHourlyForecastsWithHttpMessagesAsync(IList coordinates, string language = default(string), int? duration = 1, bool? includePollutantDetails = default(bool?), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (coordinates == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "coordinates"); + } + if (coordinates != null) + { + if (coordinates.Count > 2) + { + throw new ValidationException(ValidationRules.MaxItems, "coordinates", 2); + } + if (coordinates.Count < 2) + { + throw new ValidationException(ValidationRules.MinItems, "coordinates", 2); + } + } + string format = "json"; + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("format", format); + tracingParameters.Add("language", language); + tracingParameters.Add("coordinates", coordinates); + tracingParameters.Add("duration", duration); + tracingParameters.Add("includePollutantDetails", includePollutantDetails); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "GetAirQualityHourlyForecasts", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "weather/airQuality/forecasts/hourly/{format}").ToString(); + _url = _url.Replace("{format}", System.Uri.EscapeDataString(format)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (language != null) + { + _queryParameters.Add(string.Format("language={0}", System.Uri.EscapeDataString(language))); + } + if (coordinates != null) + { + _queryParameters.Add(string.Format("query={0}", System.Uri.EscapeDataString(string.Join(",", coordinates)))); + } + if (duration != null) + { + _queryParameters.Add(string.Format("duration={0}", System.Uri.EscapeDataString(SafeJsonConvert.SerializeObject(duration, Client.SerializationSettings).Trim('"')))); + } + if (includePollutantDetails != null) + { + _queryParameters.Add(string.Format("pollutants={0}", System.Uri.EscapeDataString(SafeJsonConvert.SerializeObject(includePollutantDetails, Client.SerializationSettings).Trim('"')))); + } + if (_queryParameters.Count > 0) + { + _url += "?" + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.ClientId != null) + { + if (_httpRequest.Headers.Contains("x-ms-client-id")) + { + _httpRequest.Headers.Remove("x-ms-client-id"); + } + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-id", Client.ClientId); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + ErrorResponse _errorBody = SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new HttpOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// **Get Daily Historical Actuals** + /// + /// + /// **Applies to**: see pricing [tiers](https://aka.ms/AzureMapsPricingTier). + /// + /// + /// Get Daily Historical Actuals service returns climatology data such as past + /// daily actual observed temperatures, precipitation, snowfall, snow depth and + /// cooling/heating degree day information, for the day at a given coordinate + /// location. The data is requested for a specified date range, up to 31 days + /// in a single API request. Generally, historical data may be available as far + /// back as the last 5 to 40+ years, depending on the location. + /// + /// + /// The applicable query specified as a comma separated string composed by + /// latitude followed by longitude e.g. "47.641268,-122.125679". + /// + /// + /// Start date in ISO 8601 format, for example, 2019-10-27. The date range + /// supported is 1 to 31 calendar days, so be sure to specify a startDate and + /// endDate that does not exceed a maximum of 31 days (i.e.: + /// startDate=2012-01-01&endDate=2012-01-31). + /// + /// + /// End date in ISO 8601 format, for example, 2019-10-28. The date range + /// supported is 1 to 31 calendar days, so be sure to specify a startDate and + /// endDate that does not exceed a maximum of 31 days (i.e.: + /// startDate=2012-01-01&endDate=2012-01-31). + /// + /// + /// Specifies to return the data in either metric units or imperial units. + /// Default value is metric. Possible values include: 'metric', 'imperial' + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task> GetDailyHistoricalActualsWithHttpMessagesAsync(IList coordinates, System.DateTime startDate, System.DateTime endDate, string unit = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (coordinates == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "coordinates"); + } + if (coordinates != null) + { + if (coordinates.Count > 2) + { + throw new ValidationException(ValidationRules.MaxItems, "coordinates", 2); + } + if (coordinates.Count < 2) + { + throw new ValidationException(ValidationRules.MinItems, "coordinates", 2); + } + } + string format = "json"; + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("format", format); + tracingParameters.Add("coordinates", coordinates); + tracingParameters.Add("startDate", startDate); + tracingParameters.Add("endDate", endDate); + tracingParameters.Add("unit", unit); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "GetDailyHistoricalActuals", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "weather/historical/actuals/daily/{format}").ToString(); + _url = _url.Replace("{format}", System.Uri.EscapeDataString(format)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (coordinates != null) + { + _queryParameters.Add(string.Format("query={0}", System.Uri.EscapeDataString(string.Join(",", coordinates)))); + } + _queryParameters.Add(string.Format("startDate={0}", System.Uri.EscapeDataString(SafeJsonConvert.SerializeObject(startDate, new DateJsonConverter()).Trim('"')))); + _queryParameters.Add(string.Format("endDate={0}", System.Uri.EscapeDataString(SafeJsonConvert.SerializeObject(endDate, new DateJsonConverter()).Trim('"')))); + if (unit != null) + { + _queryParameters.Add(string.Format("unit={0}", System.Uri.EscapeDataString(unit))); + } + if (_queryParameters.Count > 0) + { + _url += "?" + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.ClientId != null) + { + if (_httpRequest.Headers.Contains("x-ms-client-id")) + { + _httpRequest.Headers.Remove("x-ms-client-id"); + } + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-id", Client.ClientId); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + ErrorResponse _errorBody = SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new HttpOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// **Get Daily Historical Records** + /// + /// + /// **Applies to**: see pricing [tiers](https://aka.ms/AzureMapsPricingTier). + /// + /// + /// Get Daily Historical Records service returns climatology data such as past + /// daily record temperatures, precipitation and snowfall at a given coordinate + /// location. Availability of records data will vary by location. Generally, + /// historical data may be available as far back as the last 5 to 40+ years, + /// depending on the location. + /// + /// + /// The applicable query specified as a comma separated string composed by + /// latitude followed by longitude e.g. "47.641268,-122.125679". + /// + /// + /// Start date in ISO 8601 format, for example, 2019-10-27. The date range + /// supported is 1 to 31 calendar days, so be sure to specify a startDate and + /// endDate that does not exceed a maximum of 31 days (i.e.: + /// startDate=2012-01-01&endDate=2012-01-31). + /// + /// + /// End date in ISO 8601 format, for example, 2019-10-28. The date range + /// supported is 1 to 31 calendar days, so be sure to specify a startDate and + /// endDate that does not exceed a maximum of 31 days (i.e.: + /// startDate=2012-01-01&endDate=2012-01-31). + /// + /// + /// Specifies to return the data in either metric units or imperial units. + /// Default value is metric. Possible values include: 'metric', 'imperial' + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task> GetDailyHistoricalRecordsWithHttpMessagesAsync(IList coordinates, System.DateTime startDate, System.DateTime endDate, string unit = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (coordinates == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "coordinates"); + } + if (coordinates != null) + { + if (coordinates.Count > 2) + { + throw new ValidationException(ValidationRules.MaxItems, "coordinates", 2); + } + if (coordinates.Count < 2) + { + throw new ValidationException(ValidationRules.MinItems, "coordinates", 2); + } + } + string format = "json"; + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("format", format); + tracingParameters.Add("coordinates", coordinates); + tracingParameters.Add("startDate", startDate); + tracingParameters.Add("endDate", endDate); + tracingParameters.Add("unit", unit); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "GetDailyHistoricalRecords", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "weather/historical/records/daily/{format}").ToString(); + _url = _url.Replace("{format}", System.Uri.EscapeDataString(format)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (coordinates != null) + { + _queryParameters.Add(string.Format("query={0}", System.Uri.EscapeDataString(string.Join(",", coordinates)))); + } + _queryParameters.Add(string.Format("startDate={0}", System.Uri.EscapeDataString(SafeJsonConvert.SerializeObject(startDate, new DateJsonConverter()).Trim('"')))); + _queryParameters.Add(string.Format("endDate={0}", System.Uri.EscapeDataString(SafeJsonConvert.SerializeObject(endDate, new DateJsonConverter()).Trim('"')))); + if (unit != null) + { + _queryParameters.Add(string.Format("unit={0}", System.Uri.EscapeDataString(unit))); + } + if (_queryParameters.Count > 0) + { + _url += "?" + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.ClientId != null) + { + if (_httpRequest.Headers.Contains("x-ms-client-id")) + { + _httpRequest.Headers.Remove("x-ms-client-id"); + } + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-id", Client.ClientId); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + ErrorResponse _errorBody = SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new HttpOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// **Get Daily Historical Normals** + /// + /// + /// **Applies to**: see pricing [tiers](https://aka.ms/AzureMapsPricingTier). + /// + /// + /// Get Daily Historical Normals service returns climatology data such as past + /// daily normal temperatures, precipitation and cooling/heating degree day + /// information for the day at a given coordinate location. Normals are a + /// 30-year average for temperatures and precipitation for a specific location. + /// As is standard practice in climatology, the 30-year average covers years + /// 1991-2020, this data will be used for one decade and then will reset in the + /// year 2030. Generally, historical data may be available as far back as the + /// last 5 to 40+ years, depending on the location. + /// + /// + /// The applicable query specified as a comma separated string composed by + /// latitude followed by longitude e.g. "47.641268,-122.125679". + /// + /// + /// Start date in ISO 8601 format, for example, 2019-10-27. The date range + /// supported is 1 to 31 calendar days, so be sure to specify a startDate and + /// endDate that does not exceed a maximum of 31 days (i.e.: + /// startDate=2012-01-01&endDate=2012-01-31). + /// + /// + /// End date in ISO 8601 format, for example, 2019-10-28. The date range + /// supported is 1 to 31 calendar days, so be sure to specify a startDate and + /// endDate that does not exceed a maximum of 31 days (i.e.: + /// startDate=2012-01-01&endDate=2012-01-31). + /// + /// + /// Specifies to return the data in either metric units or imperial units. + /// Default value is metric. Possible values include: 'metric', 'imperial' + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task> GetDailyHistoricalNormalsWithHttpMessagesAsync(IList coordinates, System.DateTime startDate, System.DateTime endDate, string unit = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (coordinates == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "coordinates"); + } + if (coordinates != null) + { + if (coordinates.Count > 2) + { + throw new ValidationException(ValidationRules.MaxItems, "coordinates", 2); + } + if (coordinates.Count < 2) + { + throw new ValidationException(ValidationRules.MinItems, "coordinates", 2); + } + } + string format = "json"; + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("format", format); + tracingParameters.Add("coordinates", coordinates); + tracingParameters.Add("startDate", startDate); + tracingParameters.Add("endDate", endDate); + tracingParameters.Add("unit", unit); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "GetDailyHistoricalNormals", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "weather/historical/normals/daily/{format}").ToString(); + _url = _url.Replace("{format}", System.Uri.EscapeDataString(format)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (coordinates != null) + { + _queryParameters.Add(string.Format("query={0}", System.Uri.EscapeDataString(string.Join(",", coordinates)))); + } + _queryParameters.Add(string.Format("startDate={0}", System.Uri.EscapeDataString(SafeJsonConvert.SerializeObject(startDate, new DateJsonConverter()).Trim('"')))); + _queryParameters.Add(string.Format("endDate={0}", System.Uri.EscapeDataString(SafeJsonConvert.SerializeObject(endDate, new DateJsonConverter()).Trim('"')))); + if (unit != null) + { + _queryParameters.Add(string.Format("unit={0}", System.Uri.EscapeDataString(unit))); + } + if (_queryParameters.Count > 0) + { + _url += "?" + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.ClientId != null) + { + if (_httpRequest.Headers.Contains("x-ms-client-id")) + { + _httpRequest.Headers.Remove("x-ms-client-id"); + } + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-id", Client.ClientId); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + ErrorResponse _errorBody = SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new HttpOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + } +} diff --git a/sdk/maps/Azure.Maps.Weather/src/Generated/WeatherOperationsExtensions.cs b/sdk/maps/Azure.Maps.Weather/src/Generated/WeatherOperationsExtensions.cs new file mode 100644 index 000000000000..f1073af97aeb --- /dev/null +++ b/sdk/maps/Azure.Maps.Weather/src/Generated/WeatherOperationsExtensions.cs @@ -0,0 +1,928 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Azure.Maps.Weather +{ + using Models; + using System.Collections; + using System.Collections.Generic; + using System.Threading; + using System.Threading.Tasks; + + /// + /// Extension methods for WeatherOperations. + /// + public static partial class WeatherOperationsExtensions + { + /// + /// **Get Hourly Forecast** + /// + /// **Applies to**: see pricing [tiers](https://aka.ms/AzureMapsPricingTier). + /// + /// Request detailed weather forecast by the hour for the next 1, 12, 24 (1 + /// day), 72 (3 days), 120 (5 days), and 240 hours (10 days) for the given the + /// given coordinate location. The API returns details such as temperature, + /// humidity, wind, precipitation, and ultraviolet (UV) index. + /// + /// In S0 you can request hourly forecast for the next 1, 12, 24 hours (1 day), + /// and 72 hours (3 days). In S1 you can also request hourly forecast for the + /// next 120 (5 days) and 240 hours (10 days). + /// + /// + /// The operations group for this extension method. + /// + /// + /// The applicable query specified as a comma separated string composed by + /// latitude followed by longitude e.g. "47.641268,-122.125679". + /// + /// + /// Specifies to return the data in either metric units or imperial units. + /// Default value is metric. Possible values include: 'metric', 'imperial' + /// + /// + /// Time frame of the returned weather forecast. By default, the forecast data + /// for next hour will be returned. Available values are + /// * `1` - Return forecast data for the next hour. Default value. + /// * `12` - Return hourly forecast for next 12 hours. + /// * `24` - Return hourly forecast for next 24 hours. + /// * `72` - Return hourly forecast for next 72 hours (3 days). + /// * `120` - Return hourly forecast for next 120 hours (5 days). Only + /// available in S1 SKU. + /// * `240` - Return hourly forecast for next 240 hours (10 days). Only + /// available in S1 SKU. + /// + /// + /// Language in which search results should be returned. Should be one of + /// supported IETF language tags, case insensitive. When data in specified + /// language is not available for a specific field, default language is used. + /// + /// Please refer to [Supported + /// Languages](https://docs.microsoft.com/azure/azure-maps/supported-languages) + /// for details. + /// + /// + /// The cancellation token. + /// + public static async Task GetHourlyForecastAsync(this IWeatherOperations operations, IList coordinates, string unit = default(string), int? duration = default(int?), string language = default(string), CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.GetHourlyForecastWithHttpMessagesAsync(coordinates, unit, duration, language, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// **Get Minute Forecast** + /// + /// + /// **Applies to**: see pricing [tiers](https://aka.ms/AzureMapsPricingTier). + /// + /// + /// Get Minute Forecast service returns minute-by-minute forecasts for a given + /// location for the next 120 minutes. Users can request weather forecasts in + /// the interval of 1, 5 and 15 minutes. The response will include details + /// such as the type of precipitation (including rain, snow, or a mixture of + /// both), start time, and precipitation intensity value (dBZ). + /// + /// + /// The operations group for this extension method. + /// + /// + /// The applicable query specified as a comma separated string composed by + /// latitude followed by longitude e.g. "47.641268,-122.125679". + /// + /// + /// Specifies time interval in minutes for the returned weather forecast. + /// Supported values are + /// * `1` - Retrieve forecast for 1-minute intervals. Returned by default. + /// * `5` - Retrieve forecasts for 5-minute intervals. + /// * `15` - Retrieve forecasts for 15-minute intervals. + /// + /// + /// Language in which search results should be returned. Should be one of + /// supported IETF language tags, case insensitive. When data in specified + /// language is not available for a specific field, default language is used. + /// + /// Please refer to [Supported + /// Languages](https://docs.microsoft.com/azure/azure-maps/supported-languages) + /// for details. + /// + /// + /// The cancellation token. + /// + public static async Task GetMinuteForecastAsync(this IWeatherOperations operations, IList coordinates, int? interval = default(int?), string language = default(string), CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.GetMinuteForecastWithHttpMessagesAsync(coordinates, interval, language, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// **Get Quarter-Day Forecast** + /// + /// + /// **Applies to**: see pricing [tiers](https://aka.ms/AzureMapsPricingTier). + /// + /// + /// Service returns detailed weather forecast by quarter-day for the next 1, 5, + /// 10, or 15 days for a given location. Response data is presented by quarters + /// of the day - morning, afternoon, evening, and overnight. Details such as + /// temperature, humidity, wind, precipitation, and UV index are returned. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The applicable query specified as a comma separated string composed by + /// latitude followed by longitude e.g. "47.641268,-122.125679". + /// + /// + /// Specifies to return the data in either metric units or imperial units. + /// Default value is metric. Possible values include: 'metric', 'imperial' + /// + /// + /// Specifies for how many days the quester-day forecast responses are + /// returned. Supported values are: + /// * `1` - Return forecast data for the next day. Returned by default. + /// * `5` - Return forecast data for the next 5 days. + /// * `10` - Return forecast data for next 10 days. + /// * `15` - Return forecast data for the next 15 days. + /// + /// + /// Language in which search results should be returned. Should be one of + /// supported IETF language tags, case insensitive. When data in specified + /// language is not available for a specific field, default language is used. + /// + /// Please refer to [Supported + /// Languages](https://docs.microsoft.com/azure/azure-maps/supported-languages) + /// for details. + /// + /// + /// The cancellation token. + /// + public static async Task GetQuarterDayForecastAsync(this IWeatherOperations operations, IList coordinates, string unit = default(string), int? duration = default(int?), string language = default(string), CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.GetQuarterDayForecastWithHttpMessagesAsync(coordinates, unit, duration, language, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// **Get Current Conditions** + /// + /// + /// **Applies to**: see pricing [tiers](https://aka.ms/AzureMapsPricingTier). + /// + /// + /// Get Current Conditions service returns detailed current weather conditions + /// such as precipitation, temperature and wind for a given coordinate + /// location. Also, observations from the past 6 or 24 hours for a particular + /// location can be retrieved. The basic information returned with the response + /// include details such as observation date and time, brief description of the + /// weather conditions, weather icon, precipitation indicator flags, and + /// temperature. Additional details such as RealFeel™ Temperature and UV index + /// are also returned. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The applicable query specified as a comma separated string composed by + /// latitude followed by longitude e.g. "47.641268,-122.125679". + /// + /// + /// Specifies to return the data in either metric units or imperial units. + /// Default value is metric. Possible values include: 'metric', 'imperial' + /// + /// + /// Return full details for the current conditions. Available values are + /// * `true` - Returns full details. By default all details are returned. + /// * `false` - Returns a truncated version of the current condition data, + /// which includes observation date time, weather phrase, icon code, + /// precipitation indicator flag, and temperature. + /// + /// + /// Time frame of the returned weather conditions. By default, the most current + /// weather conditions will be returned. Default value is 0. Supported values + /// are: + /// * `0` - Return the most current weather conditions. + /// * `6` - Return weather conditions from past 6 hours. + /// * `24` - Return weather conditions from past 24 hours. + /// + /// + /// Language in which search results should be returned. Should be one of + /// supported IETF language tags, case insensitive. When data in specified + /// language is not available for a specific field, default language is used. + /// + /// Please refer to [Supported + /// Languages](https://docs.microsoft.com/azure/azure-maps/supported-languages) + /// for details. + /// + /// + /// The cancellation token. + /// + public static async Task GetCurrentConditionsAsync(this IWeatherOperations operations, IList coordinates, string unit = default(string), string details = default(string), int? duration = default(int?), string language = default(string), CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.GetCurrentConditionsWithHttpMessagesAsync(coordinates, unit, details, duration, language, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// **Get Daily Forecast** + /// + /// + /// **Applies to**: see pricing [tiers](https://aka.ms/AzureMapsPricingTier). + /// + /// + /// The service returns detailed weather forecast such as temperature and wind + /// by day for the next 1, 5, 10, 15, 25, or 45 days for a given coordinate + /// location. The response include details such as temperature, wind, + /// precipitation, air quality, and UV index. + /// + /// In S0 you can request daily forecast for the next 1, 5, 10, and 15 days. In + /// S1 you can also request daily forecast for the next 25 days, and 45 days. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The applicable query specified as a comma separated string composed by + /// latitude followed by longitude e.g. "47.641268,-122.125679". + /// + /// + /// Specifies to return the data in either metric units or imperial units. + /// Default value is metric. Possible values include: 'metric', 'imperial' + /// + /// + /// Specifies for how many days the daily forecast responses are returned. + /// Available values are + /// * `1` - Return forecast data for the next day. Returned by default. + /// * `5` - Return forecast data for the next 5 days. + /// * `10` - Return forecast data for the next 10 days. + /// * `25` - Return forecast data for the next 25 days. Only available in S1 + /// SKU. + /// * `45` - Return forecast data for the next 45 days. Only available in S1 + /// SKU. + /// + /// + /// Language in which search results should be returned. Should be one of + /// supported IETF language tags, case insensitive. When data in specified + /// language is not available for a specific field, default language is used. + /// + /// Please refer to [Supported + /// Languages](https://docs.microsoft.com/azure/azure-maps/supported-languages) + /// for details. + /// + /// + /// The cancellation token. + /// + public static async Task GetDailyForecastAsync(this IWeatherOperations operations, IList coordinates, string unit = default(string), int? duration = default(int?), string language = default(string), CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.GetDailyForecastWithHttpMessagesAsync(coordinates, unit, duration, language, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// **Get Weather along route** + /// + /// + /// **Applies to**: see pricing [tiers](https://aka.ms/AzureMapsPricingTier). + /// + /// Weather along a route API returns hyper local (one kilometer or less), + /// up-to-the-minute weather nowcasts, weather hazard assessments, and + /// notifications along a route described as a sequence of waypoints. + /// This includes a list of weather hazards affecting the waypoint or route, + /// and the aggregated hazard index for each waypoint might be used to paint + /// each portion of a route according to how safe it is for the driver. When + /// submitting the waypoints, it is recommended to stay within, or close to, + /// the distance that can be traveled within 120-mins or shortly after. Data is + /// updated every five minutes. + /// + /// The service supplements Azure Maps [Route + /// Service](https://docs.microsoft.com/rest/api/maps/route) that allows you to + /// first request a route between an origin and a destination and use that as + /// an input for Weather Along Route endpoint. + /// + /// In addition, the service supports scenarios to generate weather + /// notifications for waypoints that experience an increase in intensity of a + /// weather hazard. For example, if the vehicle is expected to begin + /// experiencing heavy rain as it reaches a waypoint, a weather notification + /// for heavy rain will be generated for that waypoint allowing the end product + /// to display a heavy rain notification before the driver reaches that + /// waypoint. + /// The trigger for when to display the notification for a waypoint could be + /// based, for example, on a + /// [geofence](https://docs.microsoft.com/azure/azure-maps/tutorial-iot-hub-maps), + /// or selectable distance to the waypoint. + /// + /// The API covers all regions of the planet except latitudes above Greenland + /// and Antarctica. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Coordinates through which the route is calculated, separated by colon (:) + /// and entered in chronological order. A minimum of two waypoints is required. + /// A single API call may contain up to 60 waypoints. + /// A waypoint indicates location, ETA, and optional heading: + /// latitude,longitude,ETA,heading, where + /// * `Latitude` - Latitude coordinate in decimal degrees. + /// * `Longitude` - Longitude coordinate in decimal degrees. + /// * `ETA (estimated time of arrival)` - The number of minutes from the + /// present time that it will take for the vehicle to reach the waypoint. + /// Allowed range is from 0.0 to 120.0 minutes. + /// * `Heading` - An optional value indicating the vehicle heading as it passes + /// the waypoint. Expressed in clockwise degrees relative to true north. This + /// is issued to calculate sun glare as a driving hazard. Allowed range is from + /// 0.0 to 360.0 degrees. If not provided, a heading will automatically be + /// derived based on the position of neighboring waypoints. + /// + /// It is recommended to stay within, or close to, the distance that can be + /// traveled within 120-mins or shortly after. This way a more accurate + /// assessment can be provided for the trip and prevent isolated events not + /// being captured between waypoints. Information can and should be updated + /// along the route (especially for trips greater than 2 hours) to continuously + /// pull new waypoints moving forward, but also to ensure that forecast + /// information for content such as precipitation type and intensity is + /// accurate as storms develop and dissipate over time. + /// + /// + /// Language in which search results should be returned. Should be one of + /// supported IETF language tags, case insensitive. When data in specified + /// language is not available for a specific field, default language is used. + /// + /// Please refer to [Supported + /// Languages](https://docs.microsoft.com/azure/azure-maps/supported-languages) + /// for details. + /// + /// + /// The cancellation token. + /// + public static async Task GetWeatherAlongRouteAsync(this IWeatherOperations operations, string query, string language = default(string), CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.GetWeatherAlongRouteWithHttpMessagesAsync(query, language, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// **Get Severe Weather Alerts** + /// + /// **Applies to**: see pricing [tiers](https://aka.ms/AzureMapsPricingTier). + /// + /// Severe weather phenomenon can significantly impact our everyday life and + /// business operations. For example, severe weather conditions such as + /// tropical storms, high winds or flooding can close roads and force logistics + /// companies to reroute their fleet causing delays in reaching destinations + /// and breaking the cold chain of refrigerated food products.  Azure Maps + /// Severe Weather Alerts API returns the severe weather alerts that are + /// available worldwide from both official Government Meteorological Agencies + /// and leading global to regional weather alert providers. The service can + /// return details such as alert type, category, level and detailed description + /// about the active severe alerts for the requested location, like hurricanes, + /// thunderstorms, lightning, heat waves or forest fires. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The applicable query specified as a comma separated string composed by + /// latitude followed by longitude e.g. "47.641268,-122.125679". + /// + /// + /// Language in which search results should be returned. Should be one of + /// supported IETF language tags, case insensitive. When data in specified + /// language is not available for a specific field, default language is used. + /// + /// Please refer to [Supported + /// Languages](https://docs.microsoft.com/azure/azure-maps/supported-languages) + /// for details. + /// + /// + /// Return full details for the severe weather alerts. Available values are + /// * `true` - Returns full details. By default all details are returned. + /// * `false` - Returns a truncated version of the alerts data, which excludes + /// the area-specific full description of alert details (`alertDetails`). + /// + /// + /// The cancellation token. + /// + public static async Task GetSevereWeatherAlertsAsync(this IWeatherOperations operations, IList coordinates, string language = default(string), string details = default(string), CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.GetSevereWeatherAlertsWithHttpMessagesAsync(coordinates, language, details, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// **Get Daily Indices** + /// + /// **Applies to**: see pricing [tiers](https://aka.ms/AzureMapsPricingTier). + /// + /// There may be times when you want to know if the weather conditions are + /// optimal for a specific activity, for example, for outdoor construction, + /// indoor activities, running or farming including soil moisture information. + /// Azure Maps Indices API returns index values that will guide end users to + /// plan future activities. For example, a health mobile application can notify + /// users that today is good weather for running or for other outdoors + /// activities like for playing golf, and retail stores can optimize their + /// digital marketing campaigns based on predicted index values. The service + /// returns in daily indices values for current and next 5, 10 and 15 days + /// starting from current day. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The applicable query specified as a comma separated string composed by + /// latitude followed by longitude e.g. "47.641268,-122.125679". + /// + /// + /// Language in which search results should be returned. Should be one of + /// supported IETF language tags, case insensitive. When data in specified + /// language is not available for a specific field, default language is used. + /// + /// Please refer to [Supported + /// Languages](https://docs.microsoft.com/azure/azure-maps/supported-languages) + /// for details. + /// + /// + /// Specifies for how many days the daily indices are returned. By default, the + /// indices data for the current day will be returned. When requesting future + /// indices data, the current day is included in the response as day 1. + /// Available values are + /// * `1` - Return daily index data for the current day. Default value. + /// * `5` - Return 5 days of daily index data starting from the current day. + /// * `10` - Return 10 days of daily index data starting from the current day. + /// * `15` - Return 15 days of daily index data starting from the current day. + /// + /// + /// Numeric index identifier that can be used for restricting returned results + /// to the corresponding index type. Cannot be paired with `indexGroupId`. + /// Please refer to [Weather Service + /// Concepts](https://aka.ms/AzureMapsWeatherConcepts) for details and to see + /// the supported indices. + /// + /// + /// Numeric index group identifier that can be used for restricting returned + /// results to the corresponding subset of indices (index group). Cannot be + /// paired with `indexId`. Please refer to [Weather Service + /// Concepts](https://aka.ms/AzureMapsWeatherConcepts) for details and to see + /// the supported index groups. + /// + /// + /// The cancellation token. + /// + public static async Task GetDailyIndicesAsync(this IWeatherOperations operations, IList coordinates, string language = default(string), int? duration = default(int?), int? indexId = default(int?), int? indexGroupId = default(int?), CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.GetDailyIndicesWithHttpMessagesAsync(coordinates, language, duration, indexId, indexGroupId, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// **Get Tropical Storm Active** + /// + /// **Applies to**: see pricing [tiers](https://aka.ms/AzureMapsPricingTier). + /// + /// Get all government-issued active tropical storms. Information about the + /// tropical storms includes, government ID, basin ID, year of origin, name and + /// if it is subtropical. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The cancellation token. + /// + public static async Task GetTropicalStormActiveAsync(this IWeatherOperations operations, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.GetTropicalStormActiveWithHttpMessagesAsync(null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// **Get Tropical Storm Search** + /// + /// **Applies to**: see pricing [tiers](https://aka.ms/AzureMapsPricingTier). + /// + /// Search government-issued tropical storms by year, basin ID, and government + /// ID. Information about the tropical storms includes, government ID, basin + /// ID, status, year, name and if it is subtropical. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Year of the cyclone(s) + /// + /// + /// Basin identifier. Possible values include: 'AL', 'EP', 'SI', 'NI', 'CP', + /// 'NP', 'SP' + /// + /// + /// Government storm Id + /// + /// + /// The cancellation token. + /// + public static async Task GetTropicalStormSearchAsync(this IWeatherOperations operations, int year, string basinId = default(string), int? governmentStormId = default(int?), CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.GetTropicalStormSearchWithHttpMessagesAsync(year, basinId, governmentStormId, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// **Get Tropical Storm Forecasts** + /// + /// **Applies to**: see pricing [tiers](https://aka.ms/AzureMapsPricingTier). + /// + /// Get individual government-issued tropical storm forecasts. Information + /// about the forecasted tropical storms includes, location, status, date the + /// forecast was created, window, wind speed and wind radii. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Year of the cyclone(s) + /// + /// + /// Basin identifier. Possible values include: 'AL', 'EP', 'SI', 'NI', 'CP', + /// 'NP', 'SP' + /// + /// + /// Government storm Id + /// + /// + /// Specifies to return the data in either metric units or imperial units. + /// Default value is metric. Possible values include: 'metric', 'imperial' + /// + /// + /// When true, wind radii summary data is included in the response + /// + /// + /// When true, wind radii summary data and geoJSON details are included in the + /// response + /// + /// + /// When true, window geometry data (geoJSON) is included in the response + /// + /// + /// The cancellation token. + /// + public static async Task GetTropicalStormForecastAsync(this IWeatherOperations operations, int year, string basinId, int governmentStormId, string unit = default(string), bool? includeDetails = false, bool? includeGeometricDetails = false, bool? includeWindowGeometry = false, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.GetTropicalStormForecastWithHttpMessagesAsync(year, basinId, governmentStormId, unit, includeDetails, includeGeometricDetails, includeWindowGeometry, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// **Get Tropical Storm Locations** + /// + /// **Applies to**: see pricing [tiers](https://aka.ms/AzureMapsPricingTier). + /// + /// Get location of individual government-issued tropical storms. Information + /// about the tropical storms includes, location coordinates, geometry, basin + /// ID, date, wind details and wind radii. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Year of the cyclone(s) + /// + /// + /// Basin identifier. Possible values include: 'AL', 'EP', 'SI', 'NI', 'CP', + /// 'NP', 'SP' + /// + /// + /// Government storm Id + /// + /// + /// When true, wind radii summary data is included in the response + /// + /// + /// When true, wind radii summary data and geoJSON details are included in the + /// response + /// + /// + /// Specifies to return the data in either metric units or imperial units. + /// Default value is metric. Possible values include: 'metric', 'imperial' + /// + /// + /// When true, return the current storm location + /// + /// + /// The cancellation token. + /// + public static async Task GetTropicalStormLocationsAsync(this IWeatherOperations operations, int year, string basinId, int governmentStormId, bool? includeDetails = false, bool? includeGeometricDetails = false, string unit = default(string), bool? includeCurrentStorm = false, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.GetTropicalStormLocationsWithHttpMessagesAsync(year, basinId, governmentStormId, includeDetails, includeGeometricDetails, unit, includeCurrentStorm, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// **Get Current Air Quality** + /// + /// **Applies to**: see pricing [tiers](https://aka.ms/AzureMapsPricingTier). + /// + /// Get detailed information about the concentration of pollutants and overall + /// status for current air quality. Information includes, pollution levels, air + /// quality index values, the dominant pollutant, and a brief statement + /// summarizing risk level and suggested precautions. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The applicable query specified as a comma separated string composed by + /// latitude followed by longitude e.g. "47.641268,-122.125679". + /// + /// + /// Language in which search results should be returned. Should be one of + /// supported IETF language tags, case insensitive. When data in specified + /// language is not available for a specific field, default language is used. + /// + /// Please refer to [Supported + /// Languages](https://docs.microsoft.com/azure/azure-maps/supported-languages) + /// for details. + /// + /// + /// Boolean value that returns detailed information about each pollutant. By + /// default is True. + /// + /// + /// The cancellation token. + /// + public static async Task GetCurrentAirQualityAsync(this IWeatherOperations operations, IList coordinates, string language = default(string), bool? includePollutantDetails = default(bool?), CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.GetCurrentAirQualityWithHttpMessagesAsync(coordinates, language, includePollutantDetails, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// **Get Air Quality Daily Forecasts** + /// + /// **Applies to**: see pricing [tiers](https://aka.ms/AzureMapsPricingTier). + /// + /// Get detailed information about the concentration of pollutants and overall + /// status of forecasted daily air quality. The service can provide forecasted + /// daily air quality information for the upcoming 1 to 7 days. Information + /// includes, pollution levels, air quality index values, the dominant + /// pollutant, and a brief statement summarizing risk level and suggested + /// precautions. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The applicable query specified as a comma separated string composed by + /// latitude followed by longitude e.g. "47.641268,-122.125679". + /// + /// + /// Language in which search results should be returned. Should be one of + /// supported IETF language tags, case insensitive. When data in specified + /// language is not available for a specific field, default language is used. + /// + /// Please refer to [Supported + /// Languages](https://docs.microsoft.com/azure/azure-maps/supported-languages) + /// for details. + /// + /// + /// Specifies for how many days from now we would like to know about the air + /// quality. Available values are 1, 2, 3, 4, 5, 6, and 7. Default value is 1. + /// + /// + /// The cancellation token. + /// + public static async Task GetAirQualityDailyForecastsAsync(this IWeatherOperations operations, IList coordinates, string language = default(string), int? duration = 1, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.GetAirQualityDailyForecastsWithHttpMessagesAsync(coordinates, language, duration, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// **Get Air Quality Hourly Forecasts** + /// + /// **Applies to**: see pricing [tiers](https://aka.ms/AzureMapsPricingTier). + /// + /// Get detailed information about the concentration of pollutants and overall + /// status for forecasted upcoming hourly air quality. The service can provide + /// forecasted hourly air quality information for the upcoming time spans of 1, + /// 12, 24, 48, 72, and 96 hours. Information includes, pollution levels, air + /// quality index values, the dominant pollutant, and a brief statement + /// summarizing risk level and suggested precautions. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The applicable query specified as a comma separated string composed by + /// latitude followed by longitude e.g. "47.641268,-122.125679". + /// + /// + /// Language in which search results should be returned. Should be one of + /// supported IETF language tags, case insensitive. When data in specified + /// language is not available for a specific field, default language is used. + /// + /// Please refer to [Supported + /// Languages](https://docs.microsoft.com/azure/azure-maps/supported-languages) + /// for details. + /// + /// + /// Specifies for how many hours from now we would like to know about the air + /// quality. Available values are 1, 12, 24, 48, 72, 96. Default value is 1 + /// hour. + /// + /// + /// Boolean value that returns detailed information about each pollutant. By + /// default is True. + /// + /// + /// The cancellation token. + /// + public static async Task GetAirQualityHourlyForecastsAsync(this IWeatherOperations operations, IList coordinates, string language = default(string), int? duration = 1, bool? includePollutantDetails = default(bool?), CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.GetAirQualityHourlyForecastsWithHttpMessagesAsync(coordinates, language, duration, includePollutantDetails, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// **Get Daily Historical Actuals** + /// + /// + /// **Applies to**: see pricing [tiers](https://aka.ms/AzureMapsPricingTier). + /// + /// + /// Get Daily Historical Actuals service returns climatology data such as past + /// daily actual observed temperatures, precipitation, snowfall, snow depth and + /// cooling/heating degree day information, for the day at a given coordinate + /// location. The data is requested for a specified date range, up to 31 days + /// in a single API request. Generally, historical data may be available as far + /// back as the last 5 to 40+ years, depending on the location. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The applicable query specified as a comma separated string composed by + /// latitude followed by longitude e.g. "47.641268,-122.125679". + /// + /// + /// Start date in ISO 8601 format, for example, 2019-10-27. The date range + /// supported is 1 to 31 calendar days, so be sure to specify a startDate and + /// endDate that does not exceed a maximum of 31 days (i.e.: + /// startDate=2012-01-01&endDate=2012-01-31). + /// + /// + /// End date in ISO 8601 format, for example, 2019-10-28. The date range + /// supported is 1 to 31 calendar days, so be sure to specify a startDate and + /// endDate that does not exceed a maximum of 31 days (i.e.: + /// startDate=2012-01-01&endDate=2012-01-31). + /// + /// + /// Specifies to return the data in either metric units or imperial units. + /// Default value is metric. Possible values include: 'metric', 'imperial' + /// + /// + /// The cancellation token. + /// + public static async Task GetDailyHistoricalActualsAsync(this IWeatherOperations operations, IList coordinates, System.DateTime startDate, System.DateTime endDate, string unit = default(string), CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.GetDailyHistoricalActualsWithHttpMessagesAsync(coordinates, startDate, endDate, unit, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// **Get Daily Historical Records** + /// + /// + /// **Applies to**: see pricing [tiers](https://aka.ms/AzureMapsPricingTier). + /// + /// + /// Get Daily Historical Records service returns climatology data such as past + /// daily record temperatures, precipitation and snowfall at a given coordinate + /// location. Availability of records data will vary by location. Generally, + /// historical data may be available as far back as the last 5 to 40+ years, + /// depending on the location. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The applicable query specified as a comma separated string composed by + /// latitude followed by longitude e.g. "47.641268,-122.125679". + /// + /// + /// Start date in ISO 8601 format, for example, 2019-10-27. The date range + /// supported is 1 to 31 calendar days, so be sure to specify a startDate and + /// endDate that does not exceed a maximum of 31 days (i.e.: + /// startDate=2012-01-01&endDate=2012-01-31). + /// + /// + /// End date in ISO 8601 format, for example, 2019-10-28. The date range + /// supported is 1 to 31 calendar days, so be sure to specify a startDate and + /// endDate that does not exceed a maximum of 31 days (i.e.: + /// startDate=2012-01-01&endDate=2012-01-31). + /// + /// + /// Specifies to return the data in either metric units or imperial units. + /// Default value is metric. Possible values include: 'metric', 'imperial' + /// + /// + /// The cancellation token. + /// + public static async Task GetDailyHistoricalRecordsAsync(this IWeatherOperations operations, IList coordinates, System.DateTime startDate, System.DateTime endDate, string unit = default(string), CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.GetDailyHistoricalRecordsWithHttpMessagesAsync(coordinates, startDate, endDate, unit, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// **Get Daily Historical Normals** + /// + /// + /// **Applies to**: see pricing [tiers](https://aka.ms/AzureMapsPricingTier). + /// + /// + /// Get Daily Historical Normals service returns climatology data such as past + /// daily normal temperatures, precipitation and cooling/heating degree day + /// information for the day at a given coordinate location. Normals are a + /// 30-year average for temperatures and precipitation for a specific location. + /// As is standard practice in climatology, the 30-year average covers years + /// 1991-2020, this data will be used for one decade and then will reset in the + /// year 2030. Generally, historical data may be available as far back as the + /// last 5 to 40+ years, depending on the location. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The applicable query specified as a comma separated string composed by + /// latitude followed by longitude e.g. "47.641268,-122.125679". + /// + /// + /// Start date in ISO 8601 format, for example, 2019-10-27. The date range + /// supported is 1 to 31 calendar days, so be sure to specify a startDate and + /// endDate that does not exceed a maximum of 31 days (i.e.: + /// startDate=2012-01-01&endDate=2012-01-31). + /// + /// + /// End date in ISO 8601 format, for example, 2019-10-28. The date range + /// supported is 1 to 31 calendar days, so be sure to specify a startDate and + /// endDate that does not exceed a maximum of 31 days (i.e.: + /// startDate=2012-01-01&endDate=2012-01-31). + /// + /// + /// Specifies to return the data in either metric units or imperial units. + /// Default value is metric. Possible values include: 'metric', 'imperial' + /// + /// + /// The cancellation token. + /// + public static async Task GetDailyHistoricalNormalsAsync(this IWeatherOperations operations, IList coordinates, System.DateTime startDate, System.DateTime endDate, string unit = default(string), CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.GetDailyHistoricalNormalsWithHttpMessagesAsync(coordinates, startDate, endDate, unit, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + } +}