diff --git a/sdk/maps/Azure.Maps.Creator/src/Generated/Alias.cs b/sdk/maps/Azure.Maps.Creator/src/Generated/Alias.cs
new file mode 100644
index 000000000000..f7afe8694b0c
--- /dev/null
+++ b/sdk/maps/Azure.Maps.Creator/src/Generated/Alias.cs
@@ -0,0 +1,1027 @@
+//
+// 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.Creator
+{
+ using Microsoft.Rest;
+ 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;
+
+ ///
+ /// Alias operations.
+ ///
+ public partial class Alias : IServiceOperations, IAlias
+ {
+ ///
+ /// Initializes a new instance of the Alias class.
+ ///
+ ///
+ /// Reference to the service client.
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ public Alias(CreatorClient client)
+ {
+ if (client == null)
+ {
+ throw new System.ArgumentNullException("client");
+ }
+ Client = client;
+ }
+
+ ///
+ /// Gets a reference to the CreatorClient
+ ///
+ public CreatorClient Client { get; private set; }
+
+ ///
+ /// **Applies to:** see pricing [tiers](https://aka.ms/AzureMapsPricingTier).
+ ///
+ /// Creator makes it possible to develop applications based on your private
+ /// indoor map data using Azure Maps API and SDK.
+ /// [This](https://docs.microsoft.com/azure/azure-maps/creator-indoor-maps)
+ /// article introduces concepts and tools that apply to Azure Maps Creator.
+ ///
+ /// This API allows the caller to create an alias. You can also assign the
+ /// alias during the create request. An alias can reference an ID generated by
+ /// a creator service, but cannot reference another alias ID.
+ ///
+ /// ### Submit Create Request
+ ///
+ /// To create your alias, you will use a `POST` request. If you would like to
+ /// assign the alias during the creation, you will pass the `resourceId` query
+ /// parameter.
+ ///
+ /// ### Create Alias Response
+ ///
+ /// The Create API returns a HTTP `201 Created` response with the alias
+ /// resource in the body.
+ ///
+ /// A sample response from creating an alias:
+ ///
+ /// ```json
+ /// {
+ /// "createdTimestamp": "2020-02-13T21:19:11.123Z",
+ /// "aliasId": "a8a4b8bb-ecf4-fb27-a618-f41721552766",
+ /// "creatorDataItemId": "e89aebb9-70a3-8fe1-32bb-1fbd0c725f14",
+ /// "lastUpdatedTimestamp": "2020-02-13T21:19:22.123Z"
+ /// }
+ /// ```
+ ///
+ ///
+ /// The unique id that references a creator data item to be aliased.
+ ///
+ ///
+ /// 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> CreateWithHttpMessagesAsync(string creatorDataItemId = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
+ {
+ if (Client.Geography == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.Geography");
+ }
+ string apiVersion = "2.0";
+ // Tracing
+ bool _shouldTrace = ServiceClientTracing.IsEnabled;
+ string _invocationId = null;
+ if (_shouldTrace)
+ {
+ _invocationId = ServiceClientTracing.NextInvocationId.ToString();
+ Dictionary tracingParameters = new Dictionary();
+ tracingParameters.Add("apiVersion", apiVersion);
+ tracingParameters.Add("creatorDataItemId", creatorDataItemId);
+ tracingParameters.Add("cancellationToken", cancellationToken);
+ ServiceClientTracing.Enter(_invocationId, this, "Create", tracingParameters);
+ }
+ // Construct URL
+ var _baseUrl = Client.BaseUri;
+ var _url = _baseUrl + (_baseUrl.EndsWith("/") ? "" : "/") + "aliases";
+ _url = _url.Replace("{geography}", System.Uri.EscapeDataString(Client.Geography));
+ List _queryParameters = new List();
+ if (apiVersion != null)
+ {
+ _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion)));
+ }
+ if (creatorDataItemId != null)
+ {
+ _queryParameters.Add(string.Format("creatorDataItemId={0}", System.Uri.EscapeDataString(creatorDataItemId)));
+ }
+ if (_queryParameters.Count > 0)
+ {
+ _url += "?" + string.Join("&", _queryParameters);
+ }
+ // Create HTTP transport objects
+ var _httpRequest = new HttpRequestMessage();
+ HttpResponseMessage _httpResponse = null;
+ _httpRequest.Method = new HttpMethod("POST");
+ _httpRequest.RequestUri = new System.Uri(_url);
+ // Set Headers
+
+
+ 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 != 201)
+ {
+ var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode));
+ try
+ {
+ _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
+ ErrorResponse _errorBody = Microsoft.Rest.Serialization.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 == 201)
+ {
+ _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
+ try
+ {
+ _result.Body = Microsoft.Rest.Serialization.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);
+ }
+ }
+ try
+ {
+ _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(JsonSerializer.Create(Client.DeserializationSettings));
+ }
+ catch (JsonException ex)
+ {
+ _httpRequest.Dispose();
+ if (_httpResponse != null)
+ {
+ _httpResponse.Dispose();
+ }
+ throw new SerializationException("Unable to deserialize the headers.", _httpResponse.GetHeadersAsJson().ToString(), ex);
+ }
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.Exit(_invocationId, _result);
+ }
+ return _result;
+ }
+
+ ///
+ /// **Applies to:** see pricing [tiers](https://aka.ms/AzureMapsPricingTier).
+ ///
+ /// Creator makes it possible to develop applications based on your private
+ /// indoor map data using Azure Maps API and SDK.
+ /// [This](https://docs.microsoft.com/azure/azure-maps/creator-indoor-maps)
+ /// article introduces concepts and tools that apply to Azure Maps Creator.
+ ///
+ /// This API allows the caller to fetch a list of all previously successfully
+ /// created aliases.
+ ///
+ /// ### Submit List Request
+ ///
+ /// To list all your aliases, you will issue a `GET` request with no additional
+ /// parameters.
+ ///
+ /// ### List Data Response
+ ///
+ /// The List API returns the complete list of all aliases in `json` format. The
+ /// response contains the following details for each alias resource:
+ /// > createdTimestamp - The timestamp that the alias was created. Format
+ /// yyyy-MM-ddTHH:mm:ss.sssZ
+ /// > aliasId - The id for the alias.
+ /// > creatorDataItemId - The id for the creator data item that this alias
+ /// references (could be null if the alias has not been assigned).
+ /// > lastUpdatedTimestamp - The last time the alias was assigned to a
+ /// resource. Format yyyy-MM-ddTHH:mm:ss.sssZ
+ ///
+ /// A sample response returning 2 alias resources:
+ ///
+ /// ```json
+ /// {
+ /// "aliases": [
+ /// {
+ /// "createdTimestamp": "2020-02-13T21:19:11.123Z",
+ /// "aliasId": "a8a4b8bb-ecf4-fb27-a618-f41721552766",
+ /// "creatorDataItemId": "e89aebb9-70a3-8fe1-32bb-1fbd0c725f14",
+ /// "lastUpdatedTimestamp": "2020-02-13T21:19:22.123Z"
+ /// },
+ /// {
+ /// "createdTimestamp": "2020-02-18T19:53:33.123Z",
+ /// "aliasId": "1856dbfc-7a66-ee5a-bf8d-51dbfe1906f6",
+ /// "creatorDataItemId": null,
+ /// "lastUpdatedTimestamp": "2020-02-18T19:53:33.123Z"
+ /// }
+ /// ]
+ /// }
+ /// ```
+ ///
+ ///
+ /// 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> ListWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
+ {
+ if (Client.Geography == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.Geography");
+ }
+ string apiVersion = "2.0";
+ // Tracing
+ bool _shouldTrace = ServiceClientTracing.IsEnabled;
+ string _invocationId = null;
+ if (_shouldTrace)
+ {
+ _invocationId = ServiceClientTracing.NextInvocationId.ToString();
+ Dictionary tracingParameters = new Dictionary();
+ tracingParameters.Add("apiVersion", apiVersion);
+ tracingParameters.Add("cancellationToken", cancellationToken);
+ ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters);
+ }
+ // Construct URL
+ var _baseUrl = Client.BaseUri;
+ var _url = _baseUrl + (_baseUrl.EndsWith("/") ? "" : "/") + "aliases";
+ _url = _url.Replace("{geography}", System.Uri.EscapeDataString(Client.Geography));
+ List _queryParameters = new List();
+ if (apiVersion != null)
+ {
+ _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(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 (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 = Microsoft.Rest.Serialization.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 = Microsoft.Rest.Serialization.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;
+ }
+
+ ///
+ /// **Applies to:** see pricing [tiers](https://aka.ms/AzureMapsPricingTier).
+ ///
+ /// Creator makes it possible to develop applications based on your private
+ /// indoor map data using Azure Maps API and SDK.
+ /// [This](https://docs.microsoft.com/azure/azure-maps/creator-indoor-maps)
+ /// article introduces concepts and tools that apply to Azure Maps Creator.
+ ///
+ /// This API allows the caller to assign an alias to reference a resource.
+ ///
+ /// ### Submit Assign Request
+ ///
+ /// To assign your alias to a resource, you will use a `PUT` request with the
+ /// `aliasId` in the path and the `creatorDataItemId` passed as a query
+ /// parameter.
+ ///
+ /// ### Assign Alias Response
+ ///
+ /// The Assign API returns a HTTP `200 OK` response with the updated alias
+ /// resource in the body, if the alias was assigned successfully. A sample of
+ /// the assign response is
+ ///
+ /// ```json
+ /// {
+ /// "createdTimestamp": "2020-02-13T21:19:11.123Z",
+ /// "aliasId": "a8a4b8bb-ecf4-fb27-a618-f41721552766",
+ /// "creatorDataItemId": "e89aebb9-70a3-8fe1-32bb-1fbd0c725f14",
+ /// "lastUpdatedTimestamp": "2020-02-13T21:19:22.123Z"
+ /// }
+ /// ```
+ ///
+ ///
+ /// The unique id that references an existing alias.
+ ///
+ ///
+ /// The unique id that references a creator data item to be aliased.
+ ///
+ ///
+ /// 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> AssignWithHttpMessagesAsync(string aliasId, string creatorDataItemId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
+ {
+ if (Client.Geography == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.Geography");
+ }
+ if (aliasId == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "aliasId");
+ }
+ if (creatorDataItemId == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "creatorDataItemId");
+ }
+ string apiVersion = "2.0";
+ // Tracing
+ bool _shouldTrace = ServiceClientTracing.IsEnabled;
+ string _invocationId = null;
+ if (_shouldTrace)
+ {
+ _invocationId = ServiceClientTracing.NextInvocationId.ToString();
+ Dictionary tracingParameters = new Dictionary();
+ tracingParameters.Add("aliasId", aliasId);
+ tracingParameters.Add("apiVersion", apiVersion);
+ tracingParameters.Add("creatorDataItemId", creatorDataItemId);
+ tracingParameters.Add("cancellationToken", cancellationToken);
+ ServiceClientTracing.Enter(_invocationId, this, "Assign", tracingParameters);
+ }
+ // Construct URL
+ var _baseUrl = Client.BaseUri;
+ var _url = _baseUrl + (_baseUrl.EndsWith("/") ? "" : "/") + "aliases/{aliasId}";
+ _url = _url.Replace("{geography}", System.Uri.EscapeDataString(Client.Geography));
+ _url = _url.Replace("{aliasId}", System.Uri.EscapeDataString(aliasId));
+ List _queryParameters = new List();
+ if (apiVersion != null)
+ {
+ _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion)));
+ }
+ if (creatorDataItemId != null)
+ {
+ _queryParameters.Add(string.Format("creatorDataItemId={0}", System.Uri.EscapeDataString(creatorDataItemId)));
+ }
+ if (_queryParameters.Count > 0)
+ {
+ _url += "?" + string.Join("&", _queryParameters);
+ }
+ // Create HTTP transport objects
+ var _httpRequest = new HttpRequestMessage();
+ HttpResponseMessage _httpResponse = null;
+ _httpRequest.Method = new HttpMethod("PUT");
+ _httpRequest.RequestUri = new System.Uri(_url);
+ // Set Headers
+
+
+ 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 = Microsoft.Rest.Serialization.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 = Microsoft.Rest.Serialization.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;
+ }
+
+ ///
+ /// **Applies to:** see pricing [tiers](https://aka.ms/AzureMapsPricingTier).
+ ///
+ /// Creator makes it possible to develop applications based on your private
+ /// indoor map data using Azure Maps API and SDK.
+ /// [This](https://docs.microsoft.com/azure/azure-maps/creator-indoor-maps)
+ /// article introduces concepts and tools that apply to Azure Maps Creator.
+ ///
+ /// This API allows the caller to delete a previously created alias. You can
+ /// also use this API to delete old/unused aliases to create space for new
+ /// content.This API does not delete the references resource, only the alias
+ /// referencing the resource.
+ ///
+ /// ### Submit Delete Request
+ ///
+ /// To delete your alias you will issue a `DELETE` request where the path will
+ /// contain the `aliasId` of the alias to delete.
+ ///
+ /// ### Delete Alias Response
+ ///
+ /// The Delete API returns a HTTP `204 No Content` response with an empty body,
+ /// if the alias was deleted successfully.
+ ///
+ ///
+ /// The unique id that references an existing alias.
+ ///
+ ///
+ /// Headers that will be added to request.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ ///
+ /// Thrown when the operation returned an invalid status code
+ ///
+ ///
+ /// 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 DeleteWithHttpMessagesAsync(string aliasId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
+ {
+ if (Client.Geography == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.Geography");
+ }
+ if (aliasId == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "aliasId");
+ }
+ string apiVersion = "2.0";
+ // Tracing
+ bool _shouldTrace = ServiceClientTracing.IsEnabled;
+ string _invocationId = null;
+ if (_shouldTrace)
+ {
+ _invocationId = ServiceClientTracing.NextInvocationId.ToString();
+ Dictionary tracingParameters = new Dictionary();
+ tracingParameters.Add("aliasId", aliasId);
+ tracingParameters.Add("apiVersion", apiVersion);
+ tracingParameters.Add("cancellationToken", cancellationToken);
+ ServiceClientTracing.Enter(_invocationId, this, "Delete", tracingParameters);
+ }
+ // Construct URL
+ var _baseUrl = Client.BaseUri;
+ var _url = _baseUrl + (_baseUrl.EndsWith("/") ? "" : "/") + "aliases/{aliasId}";
+ _url = _url.Replace("{geography}", System.Uri.EscapeDataString(Client.Geography));
+ _url = _url.Replace("{aliasId}", System.Uri.EscapeDataString(aliasId));
+ List _queryParameters = new List();
+ if (apiVersion != null)
+ {
+ _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion)));
+ }
+ if (_queryParameters.Count > 0)
+ {
+ _url += "?" + string.Join("&", _queryParameters);
+ }
+ // Create HTTP transport objects
+ var _httpRequest = new HttpRequestMessage();
+ HttpResponseMessage _httpResponse = null;
+ _httpRequest.Method = new HttpMethod("DELETE");
+ _httpRequest.RequestUri = new System.Uri(_url);
+ // Set Headers
+
+
+ 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 != 204)
+ {
+ var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode));
+ try
+ {
+ _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
+ ErrorResponse _errorBody = Microsoft.Rest.Serialization.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;
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.Exit(_invocationId, _result);
+ }
+ return _result;
+ }
+
+ ///
+ /// **Applies to:** see pricing [tiers](https://aka.ms/AzureMapsPricingTier).
+ ///
+ /// Creator makes it possible to develop applications based on your private
+ /// indoor map data using Azure Maps API and SDK.
+ /// [This](https://docs.microsoft.com/azure/azure-maps/creator-indoor-maps)
+ /// article introduces concepts and tools that apply to Azure Maps Creator.
+ ///
+ /// This API allows the caller to fetch the details of a previously created
+ /// alias.
+ ///
+ /// ### Submit Get Details Request
+ ///
+ /// To get the details of your alias, you will issue a `GET` request with the
+ /// `aliasId` in the path.
+ ///
+ /// ### Get Details Response
+ ///
+ /// The Get Details API returns the previously created alias in `json` format.
+ /// The response contains the following details for the alias resource:
+ /// > createdTimestamp - The timestamp that the alias was created.
+ /// > aliasId - The id for the alias.
+ /// > creatorDataItemId - The id for the creator data item that this alias
+ /// references (could be null if the alias has not been assigned).
+ /// > lastUpdatedTimestamp - The last time the alias was assigned to a
+ /// resource.
+ ///
+ /// Here's a sample response:
+ /// ```json
+ /// {
+ /// "createdTimestamp": "2020-02-13T21:19:11.123Z",
+ /// "aliasId": "a8a4b8bb-ecf4-fb27-a618-f41721552766",
+ /// "creatorDataItemId": "e89aebb9-70a3-8fe1-32bb-1fbd0c725f14",
+ /// "lastUpdatedTimestamp": "2020-02-13T21:19:22.123Z"
+ /// }
+ /// ```
+ ///
+ ///
+ /// The unique id that references an existing alias.
+ ///
+ ///
+ /// 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> GetDetailsWithHttpMessagesAsync(string aliasId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
+ {
+ if (Client.Geography == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.Geography");
+ }
+ if (aliasId == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "aliasId");
+ }
+ string apiVersion = "2.0";
+ // Tracing
+ bool _shouldTrace = ServiceClientTracing.IsEnabled;
+ string _invocationId = null;
+ if (_shouldTrace)
+ {
+ _invocationId = ServiceClientTracing.NextInvocationId.ToString();
+ Dictionary tracingParameters = new Dictionary();
+ tracingParameters.Add("aliasId", aliasId);
+ tracingParameters.Add("apiVersion", apiVersion);
+ tracingParameters.Add("cancellationToken", cancellationToken);
+ ServiceClientTracing.Enter(_invocationId, this, "GetDetails", tracingParameters);
+ }
+ // Construct URL
+ var _baseUrl = Client.BaseUri;
+ var _url = _baseUrl + (_baseUrl.EndsWith("/") ? "" : "/") + "aliases/{aliasId}";
+ _url = _url.Replace("{geography}", System.Uri.EscapeDataString(Client.Geography));
+ _url = _url.Replace("{aliasId}", System.Uri.EscapeDataString(aliasId));
+ List _queryParameters = new List();
+ if (apiVersion != null)
+ {
+ _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(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 (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 = Microsoft.Rest.Serialization.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 = Microsoft.Rest.Serialization.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.Creator/src/Generated/AliasExtensions.cs b/sdk/maps/Azure.Maps.Creator/src/Generated/AliasExtensions.cs
new file mode 100644
index 000000000000..cf8be4cd1ac2
--- /dev/null
+++ b/sdk/maps/Azure.Maps.Creator/src/Generated/AliasExtensions.cs
@@ -0,0 +1,279 @@
+//
+// 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.Creator
+{
+ using Models;
+ using System.Threading;
+ using System.Threading.Tasks;
+
+ ///
+ /// Extension methods for Alias.
+ ///
+ public static partial class AliasExtensions
+ {
+ ///
+ /// **Applies to:** see pricing [tiers](https://aka.ms/AzureMapsPricingTier).
+ ///
+ /// Creator makes it possible to develop applications based on your private
+ /// indoor map data using Azure Maps API and SDK.
+ /// [This](https://docs.microsoft.com/azure/azure-maps/creator-indoor-maps)
+ /// article introduces concepts and tools that apply to Azure Maps Creator.
+ ///
+ /// This API allows the caller to create an alias. You can also assign the
+ /// alias during the create request. An alias can reference an ID generated by
+ /// a creator service, but cannot reference another alias ID.
+ ///
+ /// ### Submit Create Request
+ ///
+ /// To create your alias, you will use a `POST` request. If you would like to
+ /// assign the alias during the creation, you will pass the `resourceId` query
+ /// parameter.
+ ///
+ /// ### Create Alias Response
+ ///
+ /// The Create API returns a HTTP `201 Created` response with the alias
+ /// resource in the body.
+ ///
+ /// A sample response from creating an alias:
+ ///
+ /// ```json
+ /// {
+ /// "createdTimestamp": "2020-02-13T21:19:11.123Z",
+ /// "aliasId": "a8a4b8bb-ecf4-fb27-a618-f41721552766",
+ /// "creatorDataItemId": "e89aebb9-70a3-8fe1-32bb-1fbd0c725f14",
+ /// "lastUpdatedTimestamp": "2020-02-13T21:19:22.123Z"
+ /// }
+ /// ```
+ ///
+ ///
+ /// The operations group for this extension method.
+ ///
+ ///
+ /// The unique id that references a creator data item to be aliased.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ public static async Task CreateAsync(this IAlias operations, string creatorDataItemId = default(string), CancellationToken cancellationToken = default(CancellationToken))
+ {
+ using (var _result = await operations.CreateWithHttpMessagesAsync(creatorDataItemId, null, cancellationToken).ConfigureAwait(false))
+ {
+ return _result.Body;
+ }
+ }
+
+ ///
+ /// **Applies to:** see pricing [tiers](https://aka.ms/AzureMapsPricingTier).
+ ///
+ /// Creator makes it possible to develop applications based on your private
+ /// indoor map data using Azure Maps API and SDK.
+ /// [This](https://docs.microsoft.com/azure/azure-maps/creator-indoor-maps)
+ /// article introduces concepts and tools that apply to Azure Maps Creator.
+ ///
+ /// This API allows the caller to fetch a list of all previously successfully
+ /// created aliases.
+ ///
+ /// ### Submit List Request
+ ///
+ /// To list all your aliases, you will issue a `GET` request with no additional
+ /// parameters.
+ ///
+ /// ### List Data Response
+ ///
+ /// The List API returns the complete list of all aliases in `json` format. The
+ /// response contains the following details for each alias resource:
+ /// > createdTimestamp - The timestamp that the alias was created. Format
+ /// yyyy-MM-ddTHH:mm:ss.sssZ
+ /// > aliasId - The id for the alias.
+ /// > creatorDataItemId - The id for the creator data item that this alias
+ /// references (could be null if the alias has not been assigned).
+ /// > lastUpdatedTimestamp - The last time the alias was assigned to a
+ /// resource. Format yyyy-MM-ddTHH:mm:ss.sssZ
+ ///
+ /// A sample response returning 2 alias resources:
+ ///
+ /// ```json
+ /// {
+ /// "aliases": [
+ /// {
+ /// "createdTimestamp": "2020-02-13T21:19:11.123Z",
+ /// "aliasId": "a8a4b8bb-ecf4-fb27-a618-f41721552766",
+ /// "creatorDataItemId": "e89aebb9-70a3-8fe1-32bb-1fbd0c725f14",
+ /// "lastUpdatedTimestamp": "2020-02-13T21:19:22.123Z"
+ /// },
+ /// {
+ /// "createdTimestamp": "2020-02-18T19:53:33.123Z",
+ /// "aliasId": "1856dbfc-7a66-ee5a-bf8d-51dbfe1906f6",
+ /// "creatorDataItemId": null,
+ /// "lastUpdatedTimestamp": "2020-02-18T19:53:33.123Z"
+ /// }
+ /// ]
+ /// }
+ /// ```
+ ///
+ ///
+ /// The operations group for this extension method.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ public static async Task ListAsync(this IAlias operations, CancellationToken cancellationToken = default(CancellationToken))
+ {
+ using (var _result = await operations.ListWithHttpMessagesAsync(null, cancellationToken).ConfigureAwait(false))
+ {
+ return _result.Body;
+ }
+ }
+
+ ///
+ /// **Applies to:** see pricing [tiers](https://aka.ms/AzureMapsPricingTier).
+ ///
+ /// Creator makes it possible to develop applications based on your private
+ /// indoor map data using Azure Maps API and SDK.
+ /// [This](https://docs.microsoft.com/azure/azure-maps/creator-indoor-maps)
+ /// article introduces concepts and tools that apply to Azure Maps Creator.
+ ///
+ /// This API allows the caller to assign an alias to reference a resource.
+ ///
+ /// ### Submit Assign Request
+ ///
+ /// To assign your alias to a resource, you will use a `PUT` request with the
+ /// `aliasId` in the path and the `creatorDataItemId` passed as a query
+ /// parameter.
+ ///
+ /// ### Assign Alias Response
+ ///
+ /// The Assign API returns a HTTP `200 OK` response with the updated alias
+ /// resource in the body, if the alias was assigned successfully. A sample of
+ /// the assign response is
+ ///
+ /// ```json
+ /// {
+ /// "createdTimestamp": "2020-02-13T21:19:11.123Z",
+ /// "aliasId": "a8a4b8bb-ecf4-fb27-a618-f41721552766",
+ /// "creatorDataItemId": "e89aebb9-70a3-8fe1-32bb-1fbd0c725f14",
+ /// "lastUpdatedTimestamp": "2020-02-13T21:19:22.123Z"
+ /// }
+ /// ```
+ ///
+ ///
+ /// The operations group for this extension method.
+ ///
+ ///
+ /// The unique id that references an existing alias.
+ ///
+ ///
+ /// The unique id that references a creator data item to be aliased.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ public static async Task AssignAsync(this IAlias operations, string aliasId, string creatorDataItemId, CancellationToken cancellationToken = default(CancellationToken))
+ {
+ using (var _result = await operations.AssignWithHttpMessagesAsync(aliasId, creatorDataItemId, null, cancellationToken).ConfigureAwait(false))
+ {
+ return _result.Body;
+ }
+ }
+
+ ///
+ /// **Applies to:** see pricing [tiers](https://aka.ms/AzureMapsPricingTier).
+ ///
+ /// Creator makes it possible to develop applications based on your private
+ /// indoor map data using Azure Maps API and SDK.
+ /// [This](https://docs.microsoft.com/azure/azure-maps/creator-indoor-maps)
+ /// article introduces concepts and tools that apply to Azure Maps Creator.
+ ///
+ /// This API allows the caller to delete a previously created alias. You can
+ /// also use this API to delete old/unused aliases to create space for new
+ /// content.This API does not delete the references resource, only the alias
+ /// referencing the resource.
+ ///
+ /// ### Submit Delete Request
+ ///
+ /// To delete your alias you will issue a `DELETE` request where the path will
+ /// contain the `aliasId` of the alias to delete.
+ ///
+ /// ### Delete Alias Response
+ ///
+ /// The Delete API returns a HTTP `204 No Content` response with an empty body,
+ /// if the alias was deleted successfully.
+ ///
+ ///
+ /// The operations group for this extension method.
+ ///
+ ///
+ /// The unique id that references an existing alias.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ public static async Task DeleteAsync(this IAlias operations, string aliasId, CancellationToken cancellationToken = default(CancellationToken))
+ {
+ (await operations.DeleteWithHttpMessagesAsync(aliasId, null, cancellationToken).ConfigureAwait(false)).Dispose();
+ }
+
+ ///
+ /// **Applies to:** see pricing [tiers](https://aka.ms/AzureMapsPricingTier).
+ ///
+ /// Creator makes it possible to develop applications based on your private
+ /// indoor map data using Azure Maps API and SDK.
+ /// [This](https://docs.microsoft.com/azure/azure-maps/creator-indoor-maps)
+ /// article introduces concepts and tools that apply to Azure Maps Creator.
+ ///
+ /// This API allows the caller to fetch the details of a previously created
+ /// alias.
+ ///
+ /// ### Submit Get Details Request
+ ///
+ /// To get the details of your alias, you will issue a `GET` request with the
+ /// `aliasId` in the path.
+ ///
+ /// ### Get Details Response
+ ///
+ /// The Get Details API returns the previously created alias in `json` format.
+ /// The response contains the following details for the alias resource:
+ /// > createdTimestamp - The timestamp that the alias was created.
+ /// > aliasId - The id for the alias.
+ /// > creatorDataItemId - The id for the creator data item that this alias
+ /// references (could be null if the alias has not been assigned).
+ /// > lastUpdatedTimestamp - The last time the alias was assigned to a
+ /// resource.
+ ///
+ /// Here's a sample response:
+ /// ```json
+ /// {
+ /// "createdTimestamp": "2020-02-13T21:19:11.123Z",
+ /// "aliasId": "a8a4b8bb-ecf4-fb27-a618-f41721552766",
+ /// "creatorDataItemId": "e89aebb9-70a3-8fe1-32bb-1fbd0c725f14",
+ /// "lastUpdatedTimestamp": "2020-02-13T21:19:22.123Z"
+ /// }
+ /// ```
+ ///
+ ///
+ /// The operations group for this extension method.
+ ///
+ ///
+ /// The unique id that references an existing alias.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ public static async Task GetDetailsAsync(this IAlias operations, string aliasId, CancellationToken cancellationToken = default(CancellationToken))
+ {
+ using (var _result = await operations.GetDetailsWithHttpMessagesAsync(aliasId, null, cancellationToken).ConfigureAwait(false))
+ {
+ return _result.Body;
+ }
+ }
+
+ }
+}
diff --git a/sdk/maps/Azure.Maps.Creator/src/Generated/Conversion.cs b/sdk/maps/Azure.Maps.Creator/src/Generated/Conversion.cs
new file mode 100644
index 000000000000..c129bd3bcce6
--- /dev/null
+++ b/sdk/maps/Azure.Maps.Creator/src/Generated/Conversion.cs
@@ -0,0 +1,1085 @@
+//
+// 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.Creator
+{
+ using Microsoft.Rest;
+ 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;
+
+ ///
+ /// Conversion operations.
+ ///
+ public partial class Conversion : IServiceOperations, IConversion
+ {
+ ///
+ /// Initializes a new instance of the Conversion class.
+ ///
+ ///
+ /// Reference to the service client.
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ public Conversion(CreatorClient client)
+ {
+ if (client == null)
+ {
+ throw new System.ArgumentNullException("client");
+ }
+ Client = client;
+ }
+
+ ///
+ /// Gets a reference to the CreatorClient
+ ///
+ public CreatorClient Client { get; private set; }
+
+ ///
+ /// **Applies to:** see pricing [tiers](https://aka.ms/AzureMapsPricingTier).
+ ///
+ /// Creator makes it possible to develop applications based on your private
+ /// indoor map data using Azure Maps API and SDK.
+ /// [This](https://docs.microsoft.com/azure/azure-maps/creator-indoor-maps)
+ /// article introduces concepts and tools that apply to Azure Maps Creator.
+ ///
+ /// The Conversion API lets the caller import a set of DWG design files as a
+ /// zipped [Drawing Package](https://aka.ms/am-drawing-package) into Azure
+ /// Maps. The [Drawing Package](https://aka.ms/am-drawing-package) should first
+ /// be uploaded using the [Azure Maps Data
+ /// Service](https://docs.microsoft.com/rest/api/maps/data). Once uploaded, use
+ /// the `udid` returned by the [Data Upload
+ /// API](https://docs.microsoft.com/rest/api/maps/data-v2/upload-preview) to
+ /// call this Conversion API.
+ ///
+ /// ## Convert DWG package
+ ///
+ /// The Conversion API performs a [long-running
+ /// request](https://aka.ms/am-creator-lrt-v2).
+ ///
+ /// ## Debug DWG package issues
+ ///
+ ///
+ /// During the Conversion process, if there are any issues with the DWG package
+ /// [errors and warnings](https://aka.ms/am-conversion-errors) are provided in
+ /// the response along with a *diagnostic package* to visualize and diagnose
+ /// these issues. In case any issues are encountered with your DWG package, the
+ /// Conversion operation status process as detailed
+ /// [here](https://aka.ms/am-creator-lrt-v2) returns the location of the
+ /// *diagnostic package* that can be downloaded by the caller to help them
+ /// visualize and diagnose these issues. The *diagnostic package* location can
+ /// be found in the properties section of the conversion operation status
+ /// response and looks like the following:
+ ///
+ /// ```json
+ /// {
+ /// "properties": {
+ /// "diagnosticPackageLocation":
+ /// "https://us.atlas.microsoft.com/mapdata/{DiagnosticPackageId}?api-version=1.0"
+ /// }
+ /// }
+ /// ```
+ ///
+ /// The *diagnostic package* can be downloaded by executing a `HTTP GET`
+ /// request on the `diagnosticPackageLocation`.
+ /// For more details on how to use the tool to visualize and diagnose all the
+ /// errors and warnings see [Drawing Error
+ /// Visualizer](https://aka.ms/am-drawing-errors-visualizer). <br>
+ ///
+ /// A conversion operation will be marked as *success* if there are zero or
+ /// more warnings but will be marked as *failed* if any errors are encountered.
+ ///
+ ///
+ /// The unique data id for the content. The `udid` must have been obtained from
+ /// a successful [Data Upload
+ /// API](https://docs.microsoft.com/en-us/rest/api/maps/data-v2/upload-preview)
+ /// call.
+ ///
+ ///
+ /// Output ontology version. "facility-2.0" is the only supported value at this
+ /// time. Please refer to this
+ /// [article](https://docs.microsoft.com/en-us/azure/azure-maps/creator-facility-ontology)
+ /// for more information about Azure Maps Creator ontologies.
+ ///
+ ///
+ /// User provided description of the content being converted.
+ ///
+ ///
+ /// 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> ConvertWithHttpMessagesAsync(string udid, string outputOntology, string description = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
+ {
+ if (Client.Geography == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.Geography");
+ }
+ if (udid == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "udid");
+ }
+ if (outputOntology == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "outputOntology");
+ }
+ string apiVersion = "2.0";
+ // Tracing
+ bool _shouldTrace = ServiceClientTracing.IsEnabled;
+ string _invocationId = null;
+ if (_shouldTrace)
+ {
+ _invocationId = ServiceClientTracing.NextInvocationId.ToString();
+ Dictionary tracingParameters = new Dictionary();
+ tracingParameters.Add("apiVersion", apiVersion);
+ tracingParameters.Add("udid", udid);
+ tracingParameters.Add("outputOntology", outputOntology);
+ tracingParameters.Add("description", description);
+ tracingParameters.Add("cancellationToken", cancellationToken);
+ ServiceClientTracing.Enter(_invocationId, this, "Convert", tracingParameters);
+ }
+ // Construct URL
+ var _baseUrl = Client.BaseUri;
+ var _url = _baseUrl + (_baseUrl.EndsWith("/") ? "" : "/") + "conversions";
+ _url = _url.Replace("{geography}", System.Uri.EscapeDataString(Client.Geography));
+ List _queryParameters = new List();
+ if (apiVersion != null)
+ {
+ _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion)));
+ }
+ if (udid != null)
+ {
+ _queryParameters.Add(string.Format("udid={0}", System.Uri.EscapeDataString(udid)));
+ }
+ if (outputOntology != null)
+ {
+ _queryParameters.Add(string.Format("outputOntology={0}", System.Uri.EscapeDataString(outputOntology)));
+ }
+ if (description != null)
+ {
+ _queryParameters.Add(string.Format("description={0}", System.Uri.EscapeDataString(description)));
+ }
+ if (_queryParameters.Count > 0)
+ {
+ _url += "?" + string.Join("&", _queryParameters);
+ }
+ // Create HTTP transport objects
+ var _httpRequest = new HttpRequestMessage();
+ HttpResponseMessage _httpResponse = null;
+ _httpRequest.Method = new HttpMethod("POST");
+ _httpRequest.RequestUri = new System.Uri(_url);
+ // Set Headers
+ if (Client.XMsClientId != null)
+ {
+ if (_httpRequest.Headers.Contains("x-ms-client-id"))
+ {
+ _httpRequest.Headers.Remove("x-ms-client-id");
+ }
+ _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-id", Client.XMsClientId);
+ }
+
+
+ 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 && (int)_statusCode != 202)
+ {
+ var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode));
+ try
+ {
+ _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
+ ErrorResponse _errorBody = Microsoft.Rest.Serialization.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 = Microsoft.Rest.Serialization.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);
+ }
+ }
+ try
+ {
+ _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(JsonSerializer.Create(Client.DeserializationSettings));
+ }
+ catch (JsonException ex)
+ {
+ _httpRequest.Dispose();
+ if (_httpResponse != null)
+ {
+ _httpResponse.Dispose();
+ }
+ throw new SerializationException("Unable to deserialize the headers.", _httpResponse.GetHeadersAsJson().ToString(), ex);
+ }
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.Exit(_invocationId, _result);
+ }
+ return _result;
+ }
+
+ ///
+ /// **Applies to:** see pricing [tiers](https://aka.ms/AzureMapsPricingTier).
+ ///
+ /// Creator makes it possible to develop applications based on your private
+ /// indoor map data using Azure Maps API and SDK.
+ /// [This](https://docs.microsoft.com/azure/azure-maps/creator-indoor-maps)
+ /// article introduces concepts and tools that apply to Azure Maps Creator.
+ ///
+ /// This API allows the caller to fetch a list of all successful data
+ /// conversions submitted previously using the [Conversion
+ /// API](https://docs.microsoft.com/en-us/rest/api/maps/v2/conversion/convert).
+ ///
+ /// ### Submit List Request
+ ///
+ /// To list all successful conversions you will issue a `GET` request with no
+ /// additional parameters.
+ ///
+ /// ### List Data Response
+ ///
+ /// The Conversion List API returns the complete list of all conversion details
+ /// in `json` format.<br>
+ ///
+ /// Here is a sample response returning the details of two successful
+ /// conversion requests:
+ ///
+ /// <br>
+ ///
+ /// ```json
+ /// {
+ /// "conversions":
+ /// [
+ /// {
+ /// "conversionId": "54398242-ea6c-1f31-4fa6-79b1ae0fc24d",
+ /// "udid": "31838736-8b84-11ea-bc55-0242ac130003",
+ /// "created": "5/19/2020 9:00:00 AM +00:00",
+ /// "description": "User provided description.",
+ /// "featureCounts": {
+ /// "DIR": 1,
+ /// "LVL": 3,
+ /// "FCL": 1,
+ /// "UNIT": 150,
+ /// "CTG": 8,
+ /// "AEL": 0,
+ /// "OPN": 10
+ /// }
+ /// },
+ /// {
+ /// "conversionId": "2acf7d32-8b84-11ea-bc55-0242ac130003",
+ /// "udid": "1214bc58-8b84-11ea-bc55-0242ac1300039",
+ /// "created": "5/19/2020 9:00:00 AM +00:00",
+ /// "description": "User provided description.",
+ /// "featureCounts": {
+ /// "DIR": 1,
+ /// "LVL": 3,
+ /// "FCL": 1,
+ /// "UNIT": 150,
+ /// "CTG": 8,
+ /// "AEL": 0,
+ /// "OPN": 10
+ /// }
+ /// }
+ /// ]
+ /// }
+ /// ```
+ ///
+ /// <br>
+ ///
+ ///
+ /// 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> ListWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
+ {
+ if (Client.Geography == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.Geography");
+ }
+ string apiVersion = "2.0";
+ // Tracing
+ bool _shouldTrace = ServiceClientTracing.IsEnabled;
+ string _invocationId = null;
+ if (_shouldTrace)
+ {
+ _invocationId = ServiceClientTracing.NextInvocationId.ToString();
+ Dictionary tracingParameters = new Dictionary();
+ tracingParameters.Add("apiVersion", apiVersion);
+ tracingParameters.Add("cancellationToken", cancellationToken);
+ ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters);
+ }
+ // Construct URL
+ var _baseUrl = Client.BaseUri;
+ var _url = _baseUrl + (_baseUrl.EndsWith("/") ? "" : "/") + "conversions";
+ _url = _url.Replace("{geography}", System.Uri.EscapeDataString(Client.Geography));
+ List _queryParameters = new List();
+ if (apiVersion != null)
+ {
+ _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(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.XMsClientId != null)
+ {
+ if (_httpRequest.Headers.Contains("x-ms-client-id"))
+ {
+ _httpRequest.Headers.Remove("x-ms-client-id");
+ }
+ _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-id", Client.XMsClientId);
+ }
+
+
+ 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 = Microsoft.Rest.Serialization.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 = Microsoft.Rest.Serialization.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;
+ }
+
+ ///
+ /// **Applies to:** see pricing [tiers](https://aka.ms/AzureMapsPricingTier).
+ ///
+ /// Creator makes it possible to develop applications based on your private
+ /// indoor map data using Azure Maps API and SDK.
+ /// [This](https://docs.microsoft.com/azure/azure-maps/creator-indoor-maps)
+ /// article introduces concepts and tools that apply to Azure Maps Creator.
+ ///
+ /// This API allows the caller to fetch a successful data conversion submitted
+ /// previously using the [Conversion
+ /// API](https://docs.microsoft.com/en-us/rest/api/maps/v2/conversion/convert).
+ ///
+ ///
+ /// The conversion id for the content. The `conversionId` must have been
+ /// obtained from a successful [Conversion
+ /// API](https://docs.microsoft.com/en-us/rest/api/maps/v2/conversion/convert)
+ /// call.
+ ///
+ ///
+ /// 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> GetWithHttpMessagesAsync(string conversionId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
+ {
+ if (Client.Geography == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.Geography");
+ }
+ if (conversionId == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "conversionId");
+ }
+ string apiVersion = "2.0";
+ // Tracing
+ bool _shouldTrace = ServiceClientTracing.IsEnabled;
+ string _invocationId = null;
+ if (_shouldTrace)
+ {
+ _invocationId = ServiceClientTracing.NextInvocationId.ToString();
+ Dictionary tracingParameters = new Dictionary();
+ tracingParameters.Add("apiVersion", apiVersion);
+ tracingParameters.Add("conversionId", conversionId);
+ tracingParameters.Add("cancellationToken", cancellationToken);
+ ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters);
+ }
+ // Construct URL
+ var _baseUrl = Client.BaseUri;
+ var _url = _baseUrl + (_baseUrl.EndsWith("/") ? "" : "/") + "conversions/{conversionId}";
+ _url = _url.Replace("{geography}", System.Uri.EscapeDataString(Client.Geography));
+ _url = _url.Replace("{conversionId}", System.Uri.EscapeDataString(conversionId));
+ List _queryParameters = new List();
+ if (apiVersion != null)
+ {
+ _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(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.XMsClientId != null)
+ {
+ if (_httpRequest.Headers.Contains("x-ms-client-id"))
+ {
+ _httpRequest.Headers.Remove("x-ms-client-id");
+ }
+ _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-id", Client.XMsClientId);
+ }
+
+
+ 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 = Microsoft.Rest.Serialization.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 = Microsoft.Rest.Serialization.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;
+ }
+
+ ///
+ /// **Applies to:** see pricing [tiers](https://aka.ms/AzureMapsPricingTier).
+ ///
+ /// Creator makes it possible to develop applications based on your private
+ /// indoor map data using Azure Maps API and SDK.
+ /// [This](https://docs.microsoft.com/azure/azure-maps/creator-indoor-maps)
+ /// article introduces concepts and tools that apply to Azure Maps Creator.
+ ///
+ /// This API allows the caller to delete any data conversions created
+ /// previously using the [Conversion
+ /// API](https://docs.microsoft.com/en-us/rest/api/maps/v2/conversion/convert).
+ ///
+ /// ### Submit Delete Request
+ ///
+ /// To delete your conversion data you will issue a `DELETE` request where the
+ /// path will contain the `conversionId` of the data to delete.
+ ///
+ /// ### Conversion Delete Response
+ ///
+ /// The Conversion Delete API returns a HTTP `204 No Content` response with an
+ /// empty body, if the converted data resources were deleted
+ /// successfully.<br>
+ /// A HTTP `400 Bad Request` error response will be returned if no resource
+ /// associated with the passed-in `conversionId` is found.
+ ///
+ ///
+ /// The conversion id for the content. The `conversionId` must have been
+ /// obtained from a successful [Conversion
+ /// API](https://docs.microsoft.com/en-us/rest/api/maps/v2/conversion/convert)
+ /// call.
+ ///
+ ///
+ /// Headers that will be added to request.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ ///
+ /// Thrown when the operation returned an invalid status code
+ ///
+ ///
+ /// 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 DeleteWithHttpMessagesAsync(string conversionId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
+ {
+ if (Client.Geography == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.Geography");
+ }
+ if (conversionId == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "conversionId");
+ }
+ string apiVersion = "2.0";
+ // Tracing
+ bool _shouldTrace = ServiceClientTracing.IsEnabled;
+ string _invocationId = null;
+ if (_shouldTrace)
+ {
+ _invocationId = ServiceClientTracing.NextInvocationId.ToString();
+ Dictionary tracingParameters = new Dictionary();
+ tracingParameters.Add("apiVersion", apiVersion);
+ tracingParameters.Add("conversionId", conversionId);
+ tracingParameters.Add("cancellationToken", cancellationToken);
+ ServiceClientTracing.Enter(_invocationId, this, "Delete", tracingParameters);
+ }
+ // Construct URL
+ var _baseUrl = Client.BaseUri;
+ var _url = _baseUrl + (_baseUrl.EndsWith("/") ? "" : "/") + "conversions/{conversionId}";
+ _url = _url.Replace("{geography}", System.Uri.EscapeDataString(Client.Geography));
+ _url = _url.Replace("{conversionId}", System.Uri.EscapeDataString(conversionId));
+ List _queryParameters = new List();
+ if (apiVersion != null)
+ {
+ _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion)));
+ }
+ if (_queryParameters.Count > 0)
+ {
+ _url += "?" + string.Join("&", _queryParameters);
+ }
+ // Create HTTP transport objects
+ var _httpRequest = new HttpRequestMessage();
+ HttpResponseMessage _httpResponse = null;
+ _httpRequest.Method = new HttpMethod("DELETE");
+ _httpRequest.RequestUri = new System.Uri(_url);
+ // Set Headers
+ if (Client.XMsClientId != null)
+ {
+ if (_httpRequest.Headers.Contains("x-ms-client-id"))
+ {
+ _httpRequest.Headers.Remove("x-ms-client-id");
+ }
+ _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-id", Client.XMsClientId);
+ }
+
+
+ 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 != 204)
+ {
+ var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode));
+ try
+ {
+ _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
+ ErrorResponse _errorBody = Microsoft.Rest.Serialization.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;
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.Exit(_invocationId, _result);
+ }
+ return _result;
+ }
+
+ ///
+ /// This path will be obtained from a call to POST /conversions. While in
+ /// progress, an http200 will be returned with no extra headers - followed by
+ /// an http200 with Resource-Location header once successfully completed.
+ ///
+ ///
+ /// The ID to query the status for the Conversion create/import request.
+ ///
+ ///
+ /// 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> GetOperationWithHttpMessagesAsync(string operationId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
+ {
+ if (Client.Geography == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.Geography");
+ }
+ if (operationId == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "operationId");
+ }
+ string apiVersion = "2.0";
+ // Tracing
+ bool _shouldTrace = ServiceClientTracing.IsEnabled;
+ string _invocationId = null;
+ if (_shouldTrace)
+ {
+ _invocationId = ServiceClientTracing.NextInvocationId.ToString();
+ Dictionary tracingParameters = new Dictionary();
+ tracingParameters.Add("apiVersion", apiVersion);
+ tracingParameters.Add("operationId", operationId);
+ tracingParameters.Add("cancellationToken", cancellationToken);
+ ServiceClientTracing.Enter(_invocationId, this, "GetOperation", tracingParameters);
+ }
+ // Construct URL
+ var _baseUrl = Client.BaseUri;
+ var _url = _baseUrl + (_baseUrl.EndsWith("/") ? "" : "/") + "conversions/operations/{operationId}";
+ _url = _url.Replace("{geography}", System.Uri.EscapeDataString(Client.Geography));
+ _url = _url.Replace("{operationId}", System.Uri.EscapeDataString(operationId));
+ List _queryParameters = new List();
+ if (apiVersion != null)
+ {
+ _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(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 (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 = Microsoft.Rest.Serialization.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 = Microsoft.Rest.Serialization.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);
+ }
+ }
+ try
+ {
+ _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(JsonSerializer.Create(Client.DeserializationSettings));
+ }
+ catch (JsonException ex)
+ {
+ _httpRequest.Dispose();
+ if (_httpResponse != null)
+ {
+ _httpResponse.Dispose();
+ }
+ throw new SerializationException("Unable to deserialize the headers.", _httpResponse.GetHeadersAsJson().ToString(), ex);
+ }
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.Exit(_invocationId, _result);
+ }
+ return _result;
+ }
+
+ }
+}
diff --git a/sdk/maps/Azure.Maps.Creator/src/Generated/ConversionExtensions.cs b/sdk/maps/Azure.Maps.Creator/src/Generated/ConversionExtensions.cs
new file mode 100644
index 000000000000..d1fc803b2d27
--- /dev/null
+++ b/sdk/maps/Azure.Maps.Creator/src/Generated/ConversionExtensions.cs
@@ -0,0 +1,283 @@
+//
+// 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.Creator
+{
+ using Models;
+ using System.Threading;
+ using System.Threading.Tasks;
+
+ ///
+ /// Extension methods for Conversion.
+ ///
+ public static partial class ConversionExtensions
+ {
+ ///
+ /// **Applies to:** see pricing [tiers](https://aka.ms/AzureMapsPricingTier).
+ ///
+ /// Creator makes it possible to develop applications based on your private
+ /// indoor map data using Azure Maps API and SDK.
+ /// [This](https://docs.microsoft.com/azure/azure-maps/creator-indoor-maps)
+ /// article introduces concepts and tools that apply to Azure Maps Creator.
+ ///
+ /// The Conversion API lets the caller import a set of DWG design files as a
+ /// zipped [Drawing Package](https://aka.ms/am-drawing-package) into Azure
+ /// Maps. The [Drawing Package](https://aka.ms/am-drawing-package) should first
+ /// be uploaded using the [Azure Maps Data
+ /// Service](https://docs.microsoft.com/rest/api/maps/data). Once uploaded, use
+ /// the `udid` returned by the [Data Upload
+ /// API](https://docs.microsoft.com/rest/api/maps/data-v2/upload-preview) to
+ /// call this Conversion API.
+ ///
+ /// ## Convert DWG package
+ ///
+ /// The Conversion API performs a [long-running
+ /// request](https://aka.ms/am-creator-lrt-v2).
+ ///
+ /// ## Debug DWG package issues
+ ///
+ ///
+ /// During the Conversion process, if there are any issues with the DWG package
+ /// [errors and warnings](https://aka.ms/am-conversion-errors) are provided in
+ /// the response along with a *diagnostic package* to visualize and diagnose
+ /// these issues. In case any issues are encountered with your DWG package, the
+ /// Conversion operation status process as detailed
+ /// [here](https://aka.ms/am-creator-lrt-v2) returns the location of the
+ /// *diagnostic package* that can be downloaded by the caller to help them
+ /// visualize and diagnose these issues. The *diagnostic package* location can
+ /// be found in the properties section of the conversion operation status
+ /// response and looks like the following:
+ ///
+ /// ```json
+ /// {
+ /// "properties": {
+ /// "diagnosticPackageLocation":
+ /// "https://us.atlas.microsoft.com/mapdata/{DiagnosticPackageId}?api-version=1.0"
+ /// }
+ /// }
+ /// ```
+ ///
+ /// The *diagnostic package* can be downloaded by executing a `HTTP GET`
+ /// request on the `diagnosticPackageLocation`.
+ /// For more details on how to use the tool to visualize and diagnose all the
+ /// errors and warnings see [Drawing Error
+ /// Visualizer](https://aka.ms/am-drawing-errors-visualizer). <br>
+ ///
+ /// A conversion operation will be marked as *success* if there are zero or
+ /// more warnings but will be marked as *failed* if any errors are encountered.
+ ///
+ ///
+ /// The operations group for this extension method.
+ ///
+ ///
+ /// The unique data id for the content. The `udid` must have been obtained from
+ /// a successful [Data Upload
+ /// API](https://docs.microsoft.com/en-us/rest/api/maps/data-v2/upload-preview)
+ /// call.
+ ///
+ ///
+ /// Output ontology version. "facility-2.0" is the only supported value at this
+ /// time. Please refer to this
+ /// [article](https://docs.microsoft.com/en-us/azure/azure-maps/creator-facility-ontology)
+ /// for more information about Azure Maps Creator ontologies.
+ ///
+ ///
+ /// User provided description of the content being converted.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ public static async Task ConvertAsync(this IConversion operations, string udid, string outputOntology, string description = default(string), CancellationToken cancellationToken = default(CancellationToken))
+ {
+ using (var _result = await operations.ConvertWithHttpMessagesAsync(udid, outputOntology, description, null, cancellationToken).ConfigureAwait(false))
+ {
+ return _result.Body;
+ }
+ }
+
+ ///
+ /// **Applies to:** see pricing [tiers](https://aka.ms/AzureMapsPricingTier).
+ ///
+ /// Creator makes it possible to develop applications based on your private
+ /// indoor map data using Azure Maps API and SDK.
+ /// [This](https://docs.microsoft.com/azure/azure-maps/creator-indoor-maps)
+ /// article introduces concepts and tools that apply to Azure Maps Creator.
+ ///
+ /// This API allows the caller to fetch a list of all successful data
+ /// conversions submitted previously using the [Conversion
+ /// API](https://docs.microsoft.com/en-us/rest/api/maps/v2/conversion/convert).
+ ///
+ /// ### Submit List Request
+ ///
+ /// To list all successful conversions you will issue a `GET` request with no
+ /// additional parameters.
+ ///
+ /// ### List Data Response
+ ///
+ /// The Conversion List API returns the complete list of all conversion details
+ /// in `json` format.<br>
+ ///
+ /// Here is a sample response returning the details of two successful
+ /// conversion requests:
+ ///
+ /// <br>
+ ///
+ /// ```json
+ /// {
+ /// "conversions":
+ /// [
+ /// {
+ /// "conversionId": "54398242-ea6c-1f31-4fa6-79b1ae0fc24d",
+ /// "udid": "31838736-8b84-11ea-bc55-0242ac130003",
+ /// "created": "5/19/2020 9:00:00 AM +00:00",
+ /// "description": "User provided description.",
+ /// "featureCounts": {
+ /// "DIR": 1,
+ /// "LVL": 3,
+ /// "FCL": 1,
+ /// "UNIT": 150,
+ /// "CTG": 8,
+ /// "AEL": 0,
+ /// "OPN": 10
+ /// }
+ /// },
+ /// {
+ /// "conversionId": "2acf7d32-8b84-11ea-bc55-0242ac130003",
+ /// "udid": "1214bc58-8b84-11ea-bc55-0242ac1300039",
+ /// "created": "5/19/2020 9:00:00 AM +00:00",
+ /// "description": "User provided description.",
+ /// "featureCounts": {
+ /// "DIR": 1,
+ /// "LVL": 3,
+ /// "FCL": 1,
+ /// "UNIT": 150,
+ /// "CTG": 8,
+ /// "AEL": 0,
+ /// "OPN": 10
+ /// }
+ /// }
+ /// ]
+ /// }
+ /// ```
+ ///
+ /// <br>
+ ///
+ ///
+ /// The operations group for this extension method.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ public static async Task ListAsync(this IConversion operations, CancellationToken cancellationToken = default(CancellationToken))
+ {
+ using (var _result = await operations.ListWithHttpMessagesAsync(null, cancellationToken).ConfigureAwait(false))
+ {
+ return _result.Body;
+ }
+ }
+
+ ///
+ /// **Applies to:** see pricing [tiers](https://aka.ms/AzureMapsPricingTier).
+ ///
+ /// Creator makes it possible to develop applications based on your private
+ /// indoor map data using Azure Maps API and SDK.
+ /// [This](https://docs.microsoft.com/azure/azure-maps/creator-indoor-maps)
+ /// article introduces concepts and tools that apply to Azure Maps Creator.
+ ///
+ /// This API allows the caller to fetch a successful data conversion submitted
+ /// previously using the [Conversion
+ /// API](https://docs.microsoft.com/en-us/rest/api/maps/v2/conversion/convert).
+ ///
+ ///
+ /// The operations group for this extension method.
+ ///
+ ///
+ /// The conversion id for the content. The `conversionId` must have been
+ /// obtained from a successful [Conversion
+ /// API](https://docs.microsoft.com/en-us/rest/api/maps/v2/conversion/convert)
+ /// call.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ public static async Task GetAsync(this IConversion operations, string conversionId, CancellationToken cancellationToken = default(CancellationToken))
+ {
+ using (var _result = await operations.GetWithHttpMessagesAsync(conversionId, null, cancellationToken).ConfigureAwait(false))
+ {
+ return _result.Body;
+ }
+ }
+
+ ///
+ /// **Applies to:** see pricing [tiers](https://aka.ms/AzureMapsPricingTier).
+ ///
+ /// Creator makes it possible to develop applications based on your private
+ /// indoor map data using Azure Maps API and SDK.
+ /// [This](https://docs.microsoft.com/azure/azure-maps/creator-indoor-maps)
+ /// article introduces concepts and tools that apply to Azure Maps Creator.
+ ///
+ /// This API allows the caller to delete any data conversions created
+ /// previously using the [Conversion
+ /// API](https://docs.microsoft.com/en-us/rest/api/maps/v2/conversion/convert).
+ ///
+ /// ### Submit Delete Request
+ ///
+ /// To delete your conversion data you will issue a `DELETE` request where the
+ /// path will contain the `conversionId` of the data to delete.
+ ///
+ /// ### Conversion Delete Response
+ ///
+ /// The Conversion Delete API returns a HTTP `204 No Content` response with an
+ /// empty body, if the converted data resources were deleted
+ /// successfully.<br>
+ /// A HTTP `400 Bad Request` error response will be returned if no resource
+ /// associated with the passed-in `conversionId` is found.
+ ///
+ ///
+ /// The operations group for this extension method.
+ ///
+ ///
+ /// The conversion id for the content. The `conversionId` must have been
+ /// obtained from a successful [Conversion
+ /// API](https://docs.microsoft.com/en-us/rest/api/maps/v2/conversion/convert)
+ /// call.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ public static async Task DeleteAsync(this IConversion operations, string conversionId, CancellationToken cancellationToken = default(CancellationToken))
+ {
+ (await operations.DeleteWithHttpMessagesAsync(conversionId, null, cancellationToken).ConfigureAwait(false)).Dispose();
+ }
+
+ ///
+ /// This path will be obtained from a call to POST /conversions. While in
+ /// progress, an http200 will be returned with no extra headers - followed by
+ /// an http200 with Resource-Location header once successfully completed.
+ ///
+ ///
+ /// The operations group for this extension method.
+ ///
+ ///
+ /// The ID to query the status for the Conversion create/import request.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ public static async Task GetOperationAsync(this IConversion operations, string operationId, CancellationToken cancellationToken = default(CancellationToken))
+ {
+ using (var _result = await operations.GetOperationWithHttpMessagesAsync(operationId, null, cancellationToken).ConfigureAwait(false))
+ {
+ return _result.Body;
+ }
+ }
+
+ }
+}
diff --git a/sdk/maps/Azure.Maps.Creator/src/Generated/CreatorClient.cs b/sdk/maps/Azure.Maps.Creator/src/Generated/CreatorClient.cs
new file mode 100644
index 000000000000..192b7970efb1
--- /dev/null
+++ b/sdk/maps/Azure.Maps.Creator/src/Generated/CreatorClient.cs
@@ -0,0 +1,268 @@
+//
+// 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.Creator
+{
+ 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 CreatorClient : ServiceClient, ICreatorClient
+ {
+ ///
+ /// The base URI of the service.
+ ///
+ internal string 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; }
+
+ ///
+ /// This parameter specifies where the Azure Maps Creator resource is located.
+ /// Valid values are us and eu. Possible values include: 'us', 'eu'
+ ///
+ public string Geography { 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 XMsClientId { get; set; }
+
+ ///
+ /// Subscription credentials which uniquely identify client subscription.
+ ///
+ public ServiceClientCredentials Credentials { get; private set; }
+
+ ///
+ /// Gets the IAlias.
+ ///
+ public virtual IAlias Alias { get; private set; }
+
+ ///
+ /// Gets the IData.
+ ///
+ public virtual IData Data { get; private set; }
+
+ ///
+ /// Gets the IDataset.
+ ///
+ public virtual IDataset Dataset { get; private set; }
+
+ ///
+ /// Gets the IConversion.
+ ///
+ public virtual IConversion Conversion { get; private set; }
+
+ ///
+ /// Gets the IFeatureState.
+ ///
+ public virtual IFeatureState FeatureState { get; private set; }
+
+ ///
+ /// Gets the ISpatial.
+ ///
+ public virtual ISpatial Spatial { get; private set; }
+
+ ///
+ /// Gets the ITileset.
+ ///
+ public virtual ITileset Tileset { get; private set; }
+
+ ///
+ /// Gets the IWFS.
+ ///
+ public virtual IWFS WFS { get; private set; }
+
+ ///
+ /// Initializes a new instance of the CreatorClient class.
+ ///
+ ///
+ /// HttpClient to be used
+ ///
+ ///
+ /// True: will dispose the provided httpClient on calling CreatorClient.Dispose(). False: will not dispose provided httpClient
+ protected CreatorClient(HttpClient httpClient, bool disposeHttpClient) : base(httpClient, disposeHttpClient)
+ {
+ Initialize();
+ }
+
+ ///
+ /// Initializes a new instance of the CreatorClient class.
+ ///
+ ///
+ /// Optional. The delegating handlers to add to the http client pipeline.
+ ///
+ protected CreatorClient(params DelegatingHandler[] handlers) : base(handlers)
+ {
+ Initialize();
+ }
+
+ ///
+ /// Initializes a new instance of the CreatorClient class.
+ ///
+ ///
+ /// Optional. The http client handler used to handle http transport.
+ ///
+ ///
+ /// Optional. The delegating handlers to add to the http client pipeline.
+ ///
+ protected CreatorClient(HttpClientHandler rootHandler, params DelegatingHandler[] handlers) : base(rootHandler, handlers)
+ {
+ Initialize();
+ }
+
+ ///
+ /// Initializes a new instance of the CreatorClient 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 CreatorClient(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 CreatorClient class.
+ ///
+ ///
+ /// Required. Subscription credentials which uniquely identify client subscription.
+ ///
+ ///
+ /// HttpClient to be used
+ ///
+ ///
+ /// True: will dispose the provided httpClient on calling CreatorClient.Dispose(). False: will not dispose provided httpClient
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ public CreatorClient(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 CreatorClient 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 CreatorClient(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);
+ }
+ }
+
+ ///
+ /// An optional partial-method to perform custom initialization.
+ ///
+ partial void CustomInitialize();
+ ///
+ /// Initializes client properties.
+ ///
+ private void Initialize()
+ {
+ Alias = new Alias(this);
+ Data = new Data(this);
+ Dataset = new Dataset(this);
+ Conversion = new Conversion(this);
+ FeatureState = new FeatureState(this);
+ Spatial = new Spatial(this);
+ Tileset = new Tileset(this);
+ WFS = new WFS(this);
+ BaseUri = "https://{geography}.atlas.microsoft.com";
+ Geography = "us";
+ 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"));
+ SerializationSettings.Converters.Add(new PolymorphicSerializeJsonConverter("type"));
+ DeserializationSettings.Converters.Add(new PolymorphicDeserializeJsonConverter("type"));
+ CustomInitialize();
+ }
+ }
+}
diff --git a/sdk/maps/Azure.Maps.Creator/src/Generated/Data.cs b/sdk/maps/Azure.Maps.Creator/src/Generated/Data.cs
new file mode 100644
index 000000000000..ea5e609dea14
--- /dev/null
+++ b/sdk/maps/Azure.Maps.Creator/src/Generated/Data.cs
@@ -0,0 +1,1452 @@
+//
+// 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.Creator
+{
+ using Microsoft.Rest;
+ 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;
+
+ ///
+ /// Data operations.
+ ///
+ public partial class Data : IServiceOperations, IData
+ {
+ ///
+ /// Initializes a new instance of the Data class.
+ ///
+ ///
+ /// Reference to the service client.
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ public Data(CreatorClient client)
+ {
+ if (client == null)
+ {
+ throw new System.ArgumentNullException("client");
+ }
+ Client = client;
+ }
+
+ ///
+ /// Gets a reference to the CreatorClient
+ ///
+ public CreatorClient Client { get; private set; }
+
+ ///
+ /// **Applies to:** see pricing [tiers](https://aka.ms/AzureMapsPricingTier).
+ ///
+ /// The Data Upload API allows the caller to upload data content to the Azure
+ /// Maps service.
+ /// You can use this API in a scenario like uploading a collection of Geofences
+ /// in `GeoJSON`
+ /// format, for use in our [Azure Maps Geofencing
+ /// Service](https://docs.microsoft.com/rest/api/maps/spatial).
+ ///
+ /// ## Submit Upload Request
+ ///
+ /// To upload your content you will use a `POST` request. The request body will
+ /// contain the data to upload. The
+ /// `dataFormat` query parameter will contain the format for the data, the
+ /// `dataSharingLevel` query parameter
+ /// can contain the sharing level for the data. The `Content-Type` header will
+ /// be set to the content type of the
+ /// data.
+ ///
+ /// For example, to upload a collection of geofences in `GeoJSON` format, set
+ /// the request body to the geofence
+ /// content. Set the `dataFormat` query parameter to _geojson_, and set the
+ /// `Content-Type` header to either one
+ /// of the following media types:
+ ///
+ /// - `application/json`
+ /// - `application/vnd.geo+json`
+ /// - `application/octet-stream`
+ ///
+ /// Here's a sample request body for uploading a simple Geofence represented as
+ /// a circle geometry using a center
+ /// point and a radius. The sample below is in `GeoJSON`:
+ ///
+ /// ```json
+ /// {
+ /// "type": "FeatureCollection",
+ /// "features": [{
+ /// "type": "Feature",
+ /// "geometry": {
+ /// "type": "Point",
+ /// "coordinates": [-122.126986, 47.639754]
+ /// },
+ /// "properties": {
+ /// "geometryId": "001",
+ /// "radius": 500
+ /// }
+ /// }]
+ /// }
+ /// ```
+ ///
+ /// The Data Upload API performs a
+ /// [long-running request](https://aka.ms/am-creator-lrt-v2).
+ ///
+ /// ## Data Upload Limits
+ ///
+ /// Please, be aware that currently every Azure Maps account has a [data
+ /// storage
+ /// limit](https://docs.microsoft.com/en-us/azure/azure-resource-manager/management/azure-subscription-service-limits#azure-maps-limits).
+ /// Once the storage limit is reached, all the new upload API calls will return
+ /// a `409 Conflict` http error response.
+ /// You can always use the [Data Delete
+ /// API](https://docs.microsoft.com/rest/api/maps/data-v2/delete-preview) to
+ /// delete old/unused content and create space for new uploads.
+ ///
+ ///
+ /// Data format of the content being uploaded. Possible values include:
+ /// 'geojson', 'zip', 'dwgzippackage'
+ ///
+ ///
+ /// The content to upload.
+ ///
+ ///
+ /// The description to be given to the upload.
+ ///
+ ///
+ /// 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> UploadPreviewWithHttpMessagesAsync(string uploadDataFormat, object uploadContent, string uploadDataDescription = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
+ {
+ if (Client.Geography == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.Geography");
+ }
+ if (uploadDataFormat == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "uploadDataFormat");
+ }
+ if (uploadContent == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "uploadContent");
+ }
+ string apiVersion = "2.0";
+ // Tracing
+ bool _shouldTrace = ServiceClientTracing.IsEnabled;
+ string _invocationId = null;
+ if (_shouldTrace)
+ {
+ _invocationId = ServiceClientTracing.NextInvocationId.ToString();
+ Dictionary tracingParameters = new Dictionary();
+ tracingParameters.Add("apiVersion", apiVersion);
+ tracingParameters.Add("uploadDataDescription", uploadDataDescription);
+ tracingParameters.Add("uploadDataFormat", uploadDataFormat);
+ tracingParameters.Add("uploadContent", uploadContent);
+ tracingParameters.Add("cancellationToken", cancellationToken);
+ ServiceClientTracing.Enter(_invocationId, this, "UploadPreview", tracingParameters);
+ }
+ // Construct URL
+ var _baseUrl = Client.BaseUri;
+ var _url = _baseUrl + (_baseUrl.EndsWith("/") ? "" : "/") + "mapData";
+ _url = _url.Replace("{geography}", System.Uri.EscapeDataString(Client.Geography));
+ List _queryParameters = new List();
+ if (apiVersion != null)
+ {
+ _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion)));
+ }
+ if (uploadDataDescription != null)
+ {
+ _queryParameters.Add(string.Format("description={0}", System.Uri.EscapeDataString(uploadDataDescription)));
+ }
+ if (uploadDataFormat != null)
+ {
+ _queryParameters.Add(string.Format("dataFormat={0}", System.Uri.EscapeDataString(uploadDataFormat)));
+ }
+ if (_queryParameters.Count > 0)
+ {
+ _url += "?" + string.Join("&", _queryParameters);
+ }
+ // Create HTTP transport objects
+ var _httpRequest = new HttpRequestMessage();
+ HttpResponseMessage _httpResponse = null;
+ _httpRequest.Method = new HttpMethod("POST");
+ _httpRequest.RequestUri = new System.Uri(_url);
+ // Set Headers
+ if (Client.XMsClientId != null)
+ {
+ if (_httpRequest.Headers.Contains("x-ms-client-id"))
+ {
+ _httpRequest.Headers.Remove("x-ms-client-id");
+ }
+ _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-id", Client.XMsClientId);
+ }
+
+
+ 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;
+ if(uploadContent != null)
+ {
+ _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(uploadContent, Client.SerializationSettings);
+ _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8);
+ _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8");
+ }
+ // 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 && (int)_statusCode != 202 && (int)_statusCode != 409)
+ {
+ var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode));
+ try
+ {
+ _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
+ ErrorResponse _errorBody = Microsoft.Rest.Serialization.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 = Microsoft.Rest.Serialization.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);
+ }
+ }
+ // Deserialize Response
+ if ((int)_statusCode == 409)
+ {
+ _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
+ try
+ {
+ _result.Body = Microsoft.Rest.Serialization.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);
+ }
+ }
+ try
+ {
+ _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(JsonSerializer.Create(Client.DeserializationSettings));
+ }
+ catch (JsonException ex)
+ {
+ _httpRequest.Dispose();
+ if (_httpResponse != null)
+ {
+ _httpResponse.Dispose();
+ }
+ throw new SerializationException("Unable to deserialize the headers.", _httpResponse.GetHeadersAsJson().ToString(), ex);
+ }
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.Exit(_invocationId, _result);
+ }
+ return _result;
+ }
+
+ ///
+ /// **Applies to:** see pricing [tiers](https://aka.ms/AzureMapsPricingTier).
+ ///
+ /// This API allows the caller to fetch a list of all content uploaded
+ /// previously using the [Data Upload
+ /// API](https://docs.microsoft.com/en-us/rest/api/maps/data-v2/upload-preview).
+ ///
+ ///
+ /// ### Submit List Request
+ ///
+ /// To list all your map data content you will issue a `GET` request with no
+ /// additional parameters.
+ ///
+ ///
+ /// ### List Data Response
+ ///
+ /// The Data List API returns the complete list of all data in `json` format.
+ /// The response contains the following details for each data resource:
+ ///
+ /// > udid - The unique data id for the data resource.
+ ///
+ /// > location - The location of the data resource. Execute a HTTP `GET` on
+ /// this location to download the data.
+ ///
+ ///
+ /// Here's a sample response returning the `udid` and `location` of 3 data
+ /// resources:
+ ///
+ /// <br>
+ ///
+ /// ```json
+ /// {
+ /// "mapDataList":
+ /// [
+ /// {
+ /// "udid": "9a1288fa-1858-4a3b-b68d-13a8j5af7d7c",
+ /// "location":
+ /// "https://us.atlas.microsoft.com/mapData/9a1288fa-1858-4a3b-b68d-13a8j5af7d7c?api-version=1.0",
+ /// "sizeInBytes": 29920,
+ /// "uploadStatus": "Completed"
+ /// },
+ /// {
+ /// "udid": "8b1288fa-1958-4a2b-b68e-13a7i5af7d7c",
+ /// "location":
+ /// "https://us.atlas.microsoft.com/mapData/8b1288fa-1958-4a2b-b68e-13a7i5af7d7c?api-version=1.0",
+ /// "sizeInBytes": 1339,
+ /// "uploadStatus": "Completed"
+ /// },
+ /// {
+ /// "udid": "7c1288fa-2058-4a1b-b68f-13a6h5af7d7c",
+ /// "location":
+ /// "https://us.atlas.microsoft.com/mapData/7c1288fa-2058-4a1b-b68f-13a6h5af7d7c?api-version=1.0",
+ /// "sizeInBytes": 1650,
+ /// "uploadStatus": "Pending"
+ /// }]
+ /// }
+ /// ```
+ ///
+ /// <br>
+ ///
+ ///
+ /// 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> ListPreviewWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
+ {
+ if (Client.Geography == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.Geography");
+ }
+ string apiVersion = "2.0";
+ // Tracing
+ bool _shouldTrace = ServiceClientTracing.IsEnabled;
+ string _invocationId = null;
+ if (_shouldTrace)
+ {
+ _invocationId = ServiceClientTracing.NextInvocationId.ToString();
+ Dictionary tracingParameters = new Dictionary();
+ tracingParameters.Add("apiVersion", apiVersion);
+ tracingParameters.Add("cancellationToken", cancellationToken);
+ ServiceClientTracing.Enter(_invocationId, this, "ListPreview", tracingParameters);
+ }
+ // Construct URL
+ var _baseUrl = Client.BaseUri;
+ var _url = _baseUrl + (_baseUrl.EndsWith("/") ? "" : "/") + "mapData";
+ _url = _url.Replace("{geography}", System.Uri.EscapeDataString(Client.Geography));
+ List _queryParameters = new List();
+ if (apiVersion != null)
+ {
+ _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(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.XMsClientId != null)
+ {
+ if (_httpRequest.Headers.Contains("x-ms-client-id"))
+ {
+ _httpRequest.Headers.Remove("x-ms-client-id");
+ }
+ _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-id", Client.XMsClientId);
+ }
+
+
+ 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 = Microsoft.Rest.Serialization.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 = Microsoft.Rest.Serialization.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;
+ }
+
+ ///
+ /// **Applies to:** see pricing [tiers](https://aka.ms/AzureMapsPricingTier).
+ ///
+ /// The Data Update API allows the caller to update a previously uploaded data
+ /// content.
+ ///
+ /// You can use this API in a scenario like adding or removing geofences to or
+ /// from an existing collection of geofences.
+ /// Geofences are uploaded using the [Data Upload
+ /// API](https://docs.microsoft.com/rest/api/maps/data-v2/upload-preview), for
+ /// use in the [Azure Maps Geofencing
+ /// Service](https://docs.microsoft.com/rest/api/maps/spatial).
+ ///
+ /// Please note that the Update API will *replace* and *override* the existing
+ /// data content.
+ ///
+ /// ## Submit Update Request
+ ///
+ /// To update your content you will use a `PUT` request. The request body will
+ /// contain the new data that will replace
+ /// the existing data. The `Content-Type` header will be set to the content
+ /// type of the data, and the path will contain
+ /// the `udid` of the data to be update.
+ ///
+ /// For example, to update a collection of geofences that were previously
+ /// uploaded using the Upload API, place the new
+ /// geofence content in the request body. Set the `udid` parameter in the path
+ /// to the `udid` of the data received
+ /// previously in the upload API response. And set the `Content-Type` header to
+ /// one of the following media types:
+ ///
+ /// - `application/json`
+ /// - `application/vnd.geo+json`
+ /// - `application/octet-stream`
+ ///
+ /// Here's a sample request body for updating a simple Geofence. It's
+ /// represented as a circle geometry using a center
+ /// point and a radius. The sample below is in `GeoJSON`:
+ ///
+ /// ```json
+ /// {
+ /// "type": "FeatureCollection",
+ /// "features": [{
+ /// "type": "Feature",
+ /// "geometry": {
+ /// "type": "Point",
+ /// "coordinates": [-122.126986, 47.639754]
+ /// },
+ /// "properties": {
+ /// "geometryId": "001",
+ /// "radius": 500
+ /// }
+ /// }]
+ /// }
+ /// ```
+ ///
+ /// The previously uploaded geofence had a radius of 100m. The above request
+ /// will update it to 500m.
+ ///
+ /// The Data Update API performs a
+ /// [long-running request](https://aka.ms/am-creator-lrt-v2).
+ ///
+ /// ## Data Update Limits
+ ///
+ /// Please, be aware that currently every Azure Maps account has a [data
+ /// storage
+ /// limit](https://docs.microsoft.com/en-us/azure/azure-resource-manager/management/azure-subscription-service-limits#azure-maps-limits).
+ /// Once the storage limit is reached, all the new upload API calls will return
+ /// a `409 Conflict` http error response.
+ /// You can always use the [Data Delete
+ /// API](https://docs.microsoft.com/rest/api/maps/data-v2/delete-preview) to
+ /// delete old/unused content and create space for new uploads.
+ ///
+ ///
+ /// The unique data id for the content. The `udid` must have been obtained from
+ /// a successful [Data Upload
+ /// API](https://docs.microsoft.com/en-us/rest/api/maps/data-v2/upload-preview)
+ /// call.
+ ///
+ ///
+ /// The new content that will update/replace the previously uploaded content.
+ ///
+ ///
+ /// The description to be given to the upload.
+ ///
+ ///
+ /// 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> UpdatePreviewWithHttpMessagesAsync(string uniqueDataId, object updateContent, string uploadDataDescription = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
+ {
+ if (Client.Geography == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.Geography");
+ }
+ if (uniqueDataId == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "uniqueDataId");
+ }
+ if (updateContent == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "updateContent");
+ }
+ string apiVersion = "2.0";
+ // Tracing
+ bool _shouldTrace = ServiceClientTracing.IsEnabled;
+ string _invocationId = null;
+ if (_shouldTrace)
+ {
+ _invocationId = ServiceClientTracing.NextInvocationId.ToString();
+ Dictionary tracingParameters = new Dictionary();
+ tracingParameters.Add("apiVersion", apiVersion);
+ tracingParameters.Add("uniqueDataId", uniqueDataId);
+ tracingParameters.Add("uploadDataDescription", uploadDataDescription);
+ tracingParameters.Add("updateContent", updateContent);
+ tracingParameters.Add("cancellationToken", cancellationToken);
+ ServiceClientTracing.Enter(_invocationId, this, "UpdatePreview", tracingParameters);
+ }
+ // Construct URL
+ var _baseUrl = Client.BaseUri;
+ var _url = _baseUrl + (_baseUrl.EndsWith("/") ? "" : "/") + "mapData/{udid}";
+ _url = _url.Replace("{geography}", System.Uri.EscapeDataString(Client.Geography));
+ _url = _url.Replace("{udid}", System.Uri.EscapeDataString(uniqueDataId));
+ List _queryParameters = new List();
+ if (apiVersion != null)
+ {
+ _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion)));
+ }
+ if (uploadDataDescription != null)
+ {
+ _queryParameters.Add(string.Format("description={0}", System.Uri.EscapeDataString(uploadDataDescription)));
+ }
+ if (_queryParameters.Count > 0)
+ {
+ _url += "?" + string.Join("&", _queryParameters);
+ }
+ // Create HTTP transport objects
+ var _httpRequest = new HttpRequestMessage();
+ HttpResponseMessage _httpResponse = null;
+ _httpRequest.Method = new HttpMethod("PUT");
+ _httpRequest.RequestUri = new System.Uri(_url);
+ // Set Headers
+ if (Client.XMsClientId != null)
+ {
+ if (_httpRequest.Headers.Contains("x-ms-client-id"))
+ {
+ _httpRequest.Headers.Remove("x-ms-client-id");
+ }
+ _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-id", Client.XMsClientId);
+ }
+
+
+ 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;
+ if(updateContent != null)
+ {
+ _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(updateContent, Client.SerializationSettings);
+ _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8);
+ _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8");
+ }
+ // 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 && (int)_statusCode != 202 && (int)_statusCode != 409)
+ {
+ var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode));
+ try
+ {
+ _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
+ ErrorResponse _errorBody = Microsoft.Rest.Serialization.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 = Microsoft.Rest.Serialization.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);
+ }
+ }
+ // Deserialize Response
+ if ((int)_statusCode == 409)
+ {
+ _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
+ try
+ {
+ _result.Body = Microsoft.Rest.Serialization.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);
+ }
+ }
+ try
+ {
+ _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(JsonSerializer.Create(Client.DeserializationSettings));
+ }
+ catch (JsonException ex)
+ {
+ _httpRequest.Dispose();
+ if (_httpResponse != null)
+ {
+ _httpResponse.Dispose();
+ }
+ throw new SerializationException("Unable to deserialize the headers.", _httpResponse.GetHeadersAsJson().ToString(), ex);
+ }
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.Exit(_invocationId, _result);
+ }
+ return _result;
+ }
+
+ ///
+ /// **Applies to:** see pricing [tiers](https://aka.ms/AzureMapsPricingTier).
+ ///
+ /// This API allows the caller to download a previously uploaded data
+ /// content.<br>
+ /// You can use this API in a scenario like downloading an existing collection
+ /// of geofences uploaded previously using the [Data Upload
+ /// API](https://docs.microsoft.com/en-us/rest/api/maps/data-v2/upload-preview)
+ /// for use in our [Azure Maps Geofencing
+ /// Service](https://docs.microsoft.com/en-us/rest/api/maps/spatial).
+ ///
+ ///
+ /// ### Submit Download Request
+ ///
+ /// To download your content you will use a `GET` request where the path will
+ /// contain the `udid` of the data to download. Optionally, you can also pass
+ /// in an `Accept` header to specify a preference for the `Content-Type` of the
+ /// data response. <br>
+ /// For example, to download a collection of geofences previously uploaded
+ /// using the Upload API, set the `udid` parameter in the path to the `udid` of
+ /// the data received previously in the upload API response and set the
+ /// `Accept` header to either one of the following media types:
+ ///
+ /// - `application/json`
+ /// - `application/vnd.geo+json`
+ /// - `application/octet-stream`
+ ///
+ ///
+ /// ### Download Data Response
+ ///
+ /// The Download API will return a HTTP `200 OK` response if the data resource
+ /// with the passed-in `udid` is found, where the response body will contain
+ /// the content of the data resource.<br>
+ /// A HTTP `400 Bad Request` error response will be returned if the data
+ /// resource with the passed-in `udid` is not found.<br>
+ ///
+ /// Here's a sample response body for a simple geofence represented in
+ /// `GeoJSON` uploaded previously using the Upload API:
+ /// <br>
+ ///
+ /// ```json
+ /// {
+ /// "type": "FeatureCollection",
+ /// "features": [{
+ /// "type": "Feature",
+ /// "geometry": {
+ /// "type": "Point",
+ /// "coordinates": [-122.126986, 47.639754]
+ /// },
+ /// "properties": {
+ /// "geometryId": "001",
+ /// "radius": 500
+ /// }
+ /// }]
+ /// }
+ /// ```
+ ///
+ ///
+ /// The unique data id for the content. The `udid` must have been obtained from
+ /// a successful [Data Upload
+ /// API](https://docs.microsoft.com/en-us/rest/api/maps/data-v2/upload-preview)
+ /// call.
+ ///
+ ///
+ /// 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> DownloadPreviewWithHttpMessagesAsync(string uniqueDataId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
+ {
+ if (Client.Geography == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.Geography");
+ }
+ if (uniqueDataId == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "uniqueDataId");
+ }
+ string apiVersion = "2.0";
+ // Tracing
+ bool _shouldTrace = ServiceClientTracing.IsEnabled;
+ string _invocationId = null;
+ if (_shouldTrace)
+ {
+ _invocationId = ServiceClientTracing.NextInvocationId.ToString();
+ Dictionary tracingParameters = new Dictionary();
+ tracingParameters.Add("apiVersion", apiVersion);
+ tracingParameters.Add("uniqueDataId", uniqueDataId);
+ tracingParameters.Add("cancellationToken", cancellationToken);
+ ServiceClientTracing.Enter(_invocationId, this, "DownloadPreview", tracingParameters);
+ }
+ // Construct URL
+ var _baseUrl = Client.BaseUri;
+ var _url = _baseUrl + (_baseUrl.EndsWith("/") ? "" : "/") + "mapData/{udid}";
+ _url = _url.Replace("{geography}", System.Uri.EscapeDataString(Client.Geography));
+ _url = _url.Replace("{udid}", System.Uri.EscapeDataString(uniqueDataId));
+ List _queryParameters = new List();
+ if (apiVersion != null)
+ {
+ _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(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.XMsClientId != null)
+ {
+ if (_httpRequest.Headers.Contains("x-ms-client-id"))
+ {
+ _httpRequest.Headers.Remove("x-ms-client-id");
+ }
+ _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-id", Client.XMsClientId);
+ }
+
+
+ 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, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, 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 = Microsoft.Rest.Serialization.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)
+ {
+ _result.Body = await _httpResponse.Content.ReadAsStreamAsync().ConfigureAwait(false);
+ }
+ try
+ {
+ _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(JsonSerializer.Create(Client.DeserializationSettings));
+ }
+ catch (JsonException ex)
+ {
+ _httpRequest.Dispose();
+ if (_httpResponse != null)
+ {
+ _httpResponse.Dispose();
+ }
+ throw new SerializationException("Unable to deserialize the headers.", _httpResponse.GetHeadersAsJson().ToString(), ex);
+ }
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.Exit(_invocationId, _result);
+ }
+ return _result;
+ }
+
+ ///
+ /// **Applies to:** see pricing [tiers](https://aka.ms/AzureMapsPricingTier).
+ ///
+ /// This API allows the caller to delete a previously uploaded data
+ /// content.<br>
+ /// You can use this API in a scenario like removing geofences previously
+ /// uploaded using the [Data Upload
+ /// API](https://docs.microsoft.com/en-us/rest/api/maps/data-v2/upload-preview)
+ /// for use in our [Azure Maps Geofencing
+ /// Service](https://docs.microsoft.com/en-us/rest/api/maps/spatial). You can
+ /// also use this API to delete old/unused uploaded content and create space
+ /// for new content.
+ ///
+ ///
+ /// ### Submit Delete Request
+ ///
+ /// To delete your content you will issue a `DELETE` request where the path
+ /// will contain the `udid` of the data to delete.<br>
+ /// For example, to delete a collection of geofences previously uploaded using
+ /// the Upload API, set the `udid` parameter in the path to the `udid` of the
+ /// data received previously in the upload API response.
+ ///
+ ///
+ /// ### Delete Data Response
+ ///
+ /// The Data Delete API returns a HTTP `204 No Content` response with an empty
+ /// body, if the data resource was deleted successfully.<br>
+ /// A HTTP `400 Bad Request` error response will be returned if the data
+ /// resource with the passed-in `udid` is not found.
+ ///
+ ///
+ /// The unique data id for the content. The `udid` must have been obtained from
+ /// a successful [Data Upload
+ /// API](https://docs.microsoft.com/en-us/rest/api/maps/data-v2/upload-preview)
+ /// call.
+ ///
+ ///
+ /// Headers that will be added to request.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ ///
+ /// Thrown when the operation returned an invalid status code
+ ///
+ ///
+ /// 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 DeletePreviewWithHttpMessagesAsync(string uniqueDataId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
+ {
+ if (Client.Geography == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.Geography");
+ }
+ if (uniqueDataId == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "uniqueDataId");
+ }
+ string apiVersion = "2.0";
+ // Tracing
+ bool _shouldTrace = ServiceClientTracing.IsEnabled;
+ string _invocationId = null;
+ if (_shouldTrace)
+ {
+ _invocationId = ServiceClientTracing.NextInvocationId.ToString();
+ Dictionary tracingParameters = new Dictionary();
+ tracingParameters.Add("apiVersion", apiVersion);
+ tracingParameters.Add("uniqueDataId", uniqueDataId);
+ tracingParameters.Add("cancellationToken", cancellationToken);
+ ServiceClientTracing.Enter(_invocationId, this, "DeletePreview", tracingParameters);
+ }
+ // Construct URL
+ var _baseUrl = Client.BaseUri;
+ var _url = _baseUrl + (_baseUrl.EndsWith("/") ? "" : "/") + "mapData/{udid}";
+ _url = _url.Replace("{geography}", System.Uri.EscapeDataString(Client.Geography));
+ _url = _url.Replace("{udid}", System.Uri.EscapeDataString(uniqueDataId));
+ List _queryParameters = new List();
+ if (apiVersion != null)
+ {
+ _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion)));
+ }
+ if (_queryParameters.Count > 0)
+ {
+ _url += "?" + string.Join("&", _queryParameters);
+ }
+ // Create HTTP transport objects
+ var _httpRequest = new HttpRequestMessage();
+ HttpResponseMessage _httpResponse = null;
+ _httpRequest.Method = new HttpMethod("DELETE");
+ _httpRequest.RequestUri = new System.Uri(_url);
+ // Set Headers
+ if (Client.XMsClientId != null)
+ {
+ if (_httpRequest.Headers.Contains("x-ms-client-id"))
+ {
+ _httpRequest.Headers.Remove("x-ms-client-id");
+ }
+ _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-id", Client.XMsClientId);
+ }
+
+
+ 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 != 204)
+ {
+ var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode));
+ try
+ {
+ _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
+ ErrorResponse _errorBody = Microsoft.Rest.Serialization.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;
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.Exit(_invocationId, _result);
+ }
+ return _result;
+ }
+
+ ///
+ /// This path will be obtained from a call to POST /mapData. While in
+ /// progress, an http200 will be returned with no extra headers - followed by
+ /// an http200 with Resource-Location header once completed.
+ ///
+ ///
+ /// The ID to query the status for the data upload request.
+ ///
+ ///
+ /// 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> GetOperationPreviewWithHttpMessagesAsync(string operationId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
+ {
+ if (Client.Geography == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.Geography");
+ }
+ if (operationId == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "operationId");
+ }
+ string apiVersion = "2.0";
+ // Tracing
+ bool _shouldTrace = ServiceClientTracing.IsEnabled;
+ string _invocationId = null;
+ if (_shouldTrace)
+ {
+ _invocationId = ServiceClientTracing.NextInvocationId.ToString();
+ Dictionary tracingParameters = new Dictionary();
+ tracingParameters.Add("apiVersion", apiVersion);
+ tracingParameters.Add("operationId", operationId);
+ tracingParameters.Add("cancellationToken", cancellationToken);
+ ServiceClientTracing.Enter(_invocationId, this, "GetOperationPreview", tracingParameters);
+ }
+ // Construct URL
+ var _baseUrl = Client.BaseUri;
+ var _url = _baseUrl + (_baseUrl.EndsWith("/") ? "" : "/") + "mapData/operations/{operationId}";
+ _url = _url.Replace("{geography}", System.Uri.EscapeDataString(Client.Geography));
+ _url = _url.Replace("{operationId}", System.Uri.EscapeDataString(operationId));
+ List _queryParameters = new List();
+ if (apiVersion != null)
+ {
+ _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(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 (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 = Microsoft.Rest.Serialization.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 = Microsoft.Rest.Serialization.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);
+ }
+ }
+ try
+ {
+ _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(JsonSerializer.Create(Client.DeserializationSettings));
+ }
+ catch (JsonException ex)
+ {
+ _httpRequest.Dispose();
+ if (_httpResponse != null)
+ {
+ _httpResponse.Dispose();
+ }
+ throw new SerializationException("Unable to deserialize the headers.", _httpResponse.GetHeadersAsJson().ToString(), ex);
+ }
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.Exit(_invocationId, _result);
+ }
+ return _result;
+ }
+
+ }
+}
diff --git a/sdk/maps/Azure.Maps.Creator/src/Generated/DataExtensions.cs b/sdk/maps/Azure.Maps.Creator/src/Generated/DataExtensions.cs
new file mode 100644
index 000000000000..3fa75eff2ff9
--- /dev/null
+++ b/sdk/maps/Azure.Maps.Creator/src/Generated/DataExtensions.cs
@@ -0,0 +1,431 @@
+//
+// 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.Creator
+{
+ using Models;
+ using System.IO;
+ using System.Threading;
+ using System.Threading.Tasks;
+
+ ///
+ /// Extension methods for Data.
+ ///
+ public static partial class DataExtensions
+ {
+ ///
+ /// **Applies to:** see pricing [tiers](https://aka.ms/AzureMapsPricingTier).
+ ///
+ /// The Data Upload API allows the caller to upload data content to the Azure
+ /// Maps service.
+ /// You can use this API in a scenario like uploading a collection of Geofences
+ /// in `GeoJSON`
+ /// format, for use in our [Azure Maps Geofencing
+ /// Service](https://docs.microsoft.com/rest/api/maps/spatial).
+ ///
+ /// ## Submit Upload Request
+ ///
+ /// To upload your content you will use a `POST` request. The request body will
+ /// contain the data to upload. The
+ /// `dataFormat` query parameter will contain the format for the data, the
+ /// `dataSharingLevel` query parameter
+ /// can contain the sharing level for the data. The `Content-Type` header will
+ /// be set to the content type of the
+ /// data.
+ ///
+ /// For example, to upload a collection of geofences in `GeoJSON` format, set
+ /// the request body to the geofence
+ /// content. Set the `dataFormat` query parameter to _geojson_, and set the
+ /// `Content-Type` header to either one
+ /// of the following media types:
+ ///
+ /// - `application/json`
+ /// - `application/vnd.geo+json`
+ /// - `application/octet-stream`
+ ///
+ /// Here's a sample request body for uploading a simple Geofence represented as
+ /// a circle geometry using a center
+ /// point and a radius. The sample below is in `GeoJSON`:
+ ///
+ /// ```json
+ /// {
+ /// "type": "FeatureCollection",
+ /// "features": [{
+ /// "type": "Feature",
+ /// "geometry": {
+ /// "type": "Point",
+ /// "coordinates": [-122.126986, 47.639754]
+ /// },
+ /// "properties": {
+ /// "geometryId": "001",
+ /// "radius": 500
+ /// }
+ /// }]
+ /// }
+ /// ```
+ ///
+ /// The Data Upload API performs a
+ /// [long-running request](https://aka.ms/am-creator-lrt-v2).
+ ///
+ /// ## Data Upload Limits
+ ///
+ /// Please, be aware that currently every Azure Maps account has a [data
+ /// storage
+ /// limit](https://docs.microsoft.com/en-us/azure/azure-resource-manager/management/azure-subscription-service-limits#azure-maps-limits).
+ /// Once the storage limit is reached, all the new upload API calls will return
+ /// a `409 Conflict` http error response.
+ /// You can always use the [Data Delete
+ /// API](https://docs.microsoft.com/rest/api/maps/data-v2/delete-preview) to
+ /// delete old/unused content and create space for new uploads.
+ ///
+ ///
+ /// The operations group for this extension method.
+ ///
+ ///
+ /// Data format of the content being uploaded. Possible values include:
+ /// 'geojson', 'zip', 'dwgzippackage'
+ ///
+ ///
+ /// The content to upload.
+ ///
+ ///
+ /// The description to be given to the upload.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ public static async Task UploadPreviewAsync(this IData operations, string uploadDataFormat, object uploadContent, string uploadDataDescription = default(string), CancellationToken cancellationToken = default(CancellationToken))
+ {
+ using (var _result = await operations.UploadPreviewWithHttpMessagesAsync(uploadDataFormat, uploadContent, uploadDataDescription, null, cancellationToken).ConfigureAwait(false))
+ {
+ return _result.Body;
+ }
+ }
+
+ ///
+ /// **Applies to:** see pricing [tiers](https://aka.ms/AzureMapsPricingTier).
+ ///
+ /// This API allows the caller to fetch a list of all content uploaded
+ /// previously using the [Data Upload
+ /// API](https://docs.microsoft.com/en-us/rest/api/maps/data-v2/upload-preview).
+ ///
+ ///
+ /// ### Submit List Request
+ ///
+ /// To list all your map data content you will issue a `GET` request with no
+ /// additional parameters.
+ ///
+ ///
+ /// ### List Data Response
+ ///
+ /// The Data List API returns the complete list of all data in `json` format.
+ /// The response contains the following details for each data resource:
+ ///
+ /// > udid - The unique data id for the data resource.
+ ///
+ /// > location - The location of the data resource. Execute a HTTP `GET` on
+ /// this location to download the data.
+ ///
+ ///
+ /// Here's a sample response returning the `udid` and `location` of 3 data
+ /// resources:
+ ///
+ /// <br>
+ ///
+ /// ```json
+ /// {
+ /// "mapDataList":
+ /// [
+ /// {
+ /// "udid": "9a1288fa-1858-4a3b-b68d-13a8j5af7d7c",
+ /// "location":
+ /// "https://us.atlas.microsoft.com/mapData/9a1288fa-1858-4a3b-b68d-13a8j5af7d7c?api-version=1.0",
+ /// "sizeInBytes": 29920,
+ /// "uploadStatus": "Completed"
+ /// },
+ /// {
+ /// "udid": "8b1288fa-1958-4a2b-b68e-13a7i5af7d7c",
+ /// "location":
+ /// "https://us.atlas.microsoft.com/mapData/8b1288fa-1958-4a2b-b68e-13a7i5af7d7c?api-version=1.0",
+ /// "sizeInBytes": 1339,
+ /// "uploadStatus": "Completed"
+ /// },
+ /// {
+ /// "udid": "7c1288fa-2058-4a1b-b68f-13a6h5af7d7c",
+ /// "location":
+ /// "https://us.atlas.microsoft.com/mapData/7c1288fa-2058-4a1b-b68f-13a6h5af7d7c?api-version=1.0",
+ /// "sizeInBytes": 1650,
+ /// "uploadStatus": "Pending"
+ /// }]
+ /// }
+ /// ```
+ ///
+ /// <br>
+ ///
+ ///
+ /// The operations group for this extension method.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ public static async Task ListPreviewAsync(this IData operations, CancellationToken cancellationToken = default(CancellationToken))
+ {
+ using (var _result = await operations.ListPreviewWithHttpMessagesAsync(null, cancellationToken).ConfigureAwait(false))
+ {
+ return _result.Body;
+ }
+ }
+
+ ///
+ /// **Applies to:** see pricing [tiers](https://aka.ms/AzureMapsPricingTier).
+ ///
+ /// The Data Update API allows the caller to update a previously uploaded data
+ /// content.
+ ///
+ /// You can use this API in a scenario like adding or removing geofences to or
+ /// from an existing collection of geofences.
+ /// Geofences are uploaded using the [Data Upload
+ /// API](https://docs.microsoft.com/rest/api/maps/data-v2/upload-preview), for
+ /// use in the [Azure Maps Geofencing
+ /// Service](https://docs.microsoft.com/rest/api/maps/spatial).
+ ///
+ /// Please note that the Update API will *replace* and *override* the existing
+ /// data content.
+ ///
+ /// ## Submit Update Request
+ ///
+ /// To update your content you will use a `PUT` request. The request body will
+ /// contain the new data that will replace
+ /// the existing data. The `Content-Type` header will be set to the content
+ /// type of the data, and the path will contain
+ /// the `udid` of the data to be update.
+ ///
+ /// For example, to update a collection of geofences that were previously
+ /// uploaded using the Upload API, place the new
+ /// geofence content in the request body. Set the `udid` parameter in the path
+ /// to the `udid` of the data received
+ /// previously in the upload API response. And set the `Content-Type` header to
+ /// one of the following media types:
+ ///
+ /// - `application/json`
+ /// - `application/vnd.geo+json`
+ /// - `application/octet-stream`
+ ///
+ /// Here's a sample request body for updating a simple Geofence. It's
+ /// represented as a circle geometry using a center
+ /// point and a radius. The sample below is in `GeoJSON`:
+ ///
+ /// ```json
+ /// {
+ /// "type": "FeatureCollection",
+ /// "features": [{
+ /// "type": "Feature",
+ /// "geometry": {
+ /// "type": "Point",
+ /// "coordinates": [-122.126986, 47.639754]
+ /// },
+ /// "properties": {
+ /// "geometryId": "001",
+ /// "radius": 500
+ /// }
+ /// }]
+ /// }
+ /// ```
+ ///
+ /// The previously uploaded geofence had a radius of 100m. The above request
+ /// will update it to 500m.
+ ///
+ /// The Data Update API performs a
+ /// [long-running request](https://aka.ms/am-creator-lrt-v2).
+ ///
+ /// ## Data Update Limits
+ ///
+ /// Please, be aware that currently every Azure Maps account has a [data
+ /// storage
+ /// limit](https://docs.microsoft.com/en-us/azure/azure-resource-manager/management/azure-subscription-service-limits#azure-maps-limits).
+ /// Once the storage limit is reached, all the new upload API calls will return
+ /// a `409 Conflict` http error response.
+ /// You can always use the [Data Delete
+ /// API](https://docs.microsoft.com/rest/api/maps/data-v2/delete-preview) to
+ /// delete old/unused content and create space for new uploads.
+ ///
+ ///
+ /// The operations group for this extension method.
+ ///
+ ///
+ /// The unique data id for the content. The `udid` must have been obtained from
+ /// a successful [Data Upload
+ /// API](https://docs.microsoft.com/en-us/rest/api/maps/data-v2/upload-preview)
+ /// call.
+ ///
+ ///
+ /// The new content that will update/replace the previously uploaded content.
+ ///
+ ///
+ /// The description to be given to the upload.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ public static async Task UpdatePreviewAsync(this IData operations, string uniqueDataId, object updateContent, string uploadDataDescription = default(string), CancellationToken cancellationToken = default(CancellationToken))
+ {
+ using (var _result = await operations.UpdatePreviewWithHttpMessagesAsync(uniqueDataId, updateContent, uploadDataDescription, null, cancellationToken).ConfigureAwait(false))
+ {
+ return _result.Body;
+ }
+ }
+
+ ///
+ /// **Applies to:** see pricing [tiers](https://aka.ms/AzureMapsPricingTier).
+ ///
+ /// This API allows the caller to download a previously uploaded data
+ /// content.<br>
+ /// You can use this API in a scenario like downloading an existing collection
+ /// of geofences uploaded previously using the [Data Upload
+ /// API](https://docs.microsoft.com/en-us/rest/api/maps/data-v2/upload-preview)
+ /// for use in our [Azure Maps Geofencing
+ /// Service](https://docs.microsoft.com/en-us/rest/api/maps/spatial).
+ ///
+ ///
+ /// ### Submit Download Request
+ ///
+ /// To download your content you will use a `GET` request where the path will
+ /// contain the `udid` of the data to download. Optionally, you can also pass
+ /// in an `Accept` header to specify a preference for the `Content-Type` of the
+ /// data response. <br>
+ /// For example, to download a collection of geofences previously uploaded
+ /// using the Upload API, set the `udid` parameter in the path to the `udid` of
+ /// the data received previously in the upload API response and set the
+ /// `Accept` header to either one of the following media types:
+ ///
+ /// - `application/json`
+ /// - `application/vnd.geo+json`
+ /// - `application/octet-stream`
+ ///
+ ///
+ /// ### Download Data Response
+ ///
+ /// The Download API will return a HTTP `200 OK` response if the data resource
+ /// with the passed-in `udid` is found, where the response body will contain
+ /// the content of the data resource.<br>
+ /// A HTTP `400 Bad Request` error response will be returned if the data
+ /// resource with the passed-in `udid` is not found.<br>
+ ///
+ /// Here's a sample response body for a simple geofence represented in
+ /// `GeoJSON` uploaded previously using the Upload API:
+ /// <br>
+ ///
+ /// ```json
+ /// {
+ /// "type": "FeatureCollection",
+ /// "features": [{
+ /// "type": "Feature",
+ /// "geometry": {
+ /// "type": "Point",
+ /// "coordinates": [-122.126986, 47.639754]
+ /// },
+ /// "properties": {
+ /// "geometryId": "001",
+ /// "radius": 500
+ /// }
+ /// }]
+ /// }
+ /// ```
+ ///
+ ///
+ /// The operations group for this extension method.
+ ///
+ ///
+ /// The unique data id for the content. The `udid` must have been obtained from
+ /// a successful [Data Upload
+ /// API](https://docs.microsoft.com/en-us/rest/api/maps/data-v2/upload-preview)
+ /// call.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ public static async Task DownloadPreviewAsync(this IData operations, string uniqueDataId, CancellationToken cancellationToken = default(CancellationToken))
+ {
+ var _result = await operations.DownloadPreviewWithHttpMessagesAsync(uniqueDataId, null, cancellationToken).ConfigureAwait(false);
+ _result.Request.Dispose();
+ return _result.Body;
+ }
+
+ ///
+ /// **Applies to:** see pricing [tiers](https://aka.ms/AzureMapsPricingTier).
+ ///
+ /// This API allows the caller to delete a previously uploaded data
+ /// content.<br>
+ /// You can use this API in a scenario like removing geofences previously
+ /// uploaded using the [Data Upload
+ /// API](https://docs.microsoft.com/en-us/rest/api/maps/data-v2/upload-preview)
+ /// for use in our [Azure Maps Geofencing
+ /// Service](https://docs.microsoft.com/en-us/rest/api/maps/spatial). You can
+ /// also use this API to delete old/unused uploaded content and create space
+ /// for new content.
+ ///
+ ///
+ /// ### Submit Delete Request
+ ///
+ /// To delete your content you will issue a `DELETE` request where the path
+ /// will contain the `udid` of the data to delete.<br>
+ /// For example, to delete a collection of geofences previously uploaded using
+ /// the Upload API, set the `udid` parameter in the path to the `udid` of the
+ /// data received previously in the upload API response.
+ ///
+ ///
+ /// ### Delete Data Response
+ ///
+ /// The Data Delete API returns a HTTP `204 No Content` response with an empty
+ /// body, if the data resource was deleted successfully.<br>
+ /// A HTTP `400 Bad Request` error response will be returned if the data
+ /// resource with the passed-in `udid` is not found.
+ ///
+ ///
+ /// The operations group for this extension method.
+ ///
+ ///
+ /// The unique data id for the content. The `udid` must have been obtained from
+ /// a successful [Data Upload
+ /// API](https://docs.microsoft.com/en-us/rest/api/maps/data-v2/upload-preview)
+ /// call.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ public static async Task DeletePreviewAsync(this IData operations, string uniqueDataId, CancellationToken cancellationToken = default(CancellationToken))
+ {
+ (await operations.DeletePreviewWithHttpMessagesAsync(uniqueDataId, null, cancellationToken).ConfigureAwait(false)).Dispose();
+ }
+
+ ///
+ /// This path will be obtained from a call to POST /mapData. While in
+ /// progress, an http200 will be returned with no extra headers - followed by
+ /// an http200 with Resource-Location header once completed.
+ ///
+ ///
+ /// The operations group for this extension method.
+ ///
+ ///
+ /// The ID to query the status for the data upload request.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ public static async Task GetOperationPreviewAsync(this IData operations, string operationId, CancellationToken cancellationToken = default(CancellationToken))
+ {
+ using (var _result = await operations.GetOperationPreviewWithHttpMessagesAsync(operationId, null, cancellationToken).ConfigureAwait(false))
+ {
+ return _result.Body;
+ }
+ }
+
+ }
+}
diff --git a/sdk/maps/Azure.Maps.Creator/src/Generated/Dataset.cs b/sdk/maps/Azure.Maps.Creator/src/Generated/Dataset.cs
new file mode 100644
index 000000000000..4daca12171f4
--- /dev/null
+++ b/sdk/maps/Azure.Maps.Creator/src/Generated/Dataset.cs
@@ -0,0 +1,1105 @@
+//
+// 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.Creator
+{
+ using Microsoft.Rest;
+ 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;
+
+ ///
+ /// Dataset operations.
+ ///
+ public partial class Dataset : IServiceOperations, IDataset
+ {
+ ///
+ /// Initializes a new instance of the Dataset class.
+ ///
+ ///
+ /// Reference to the service client.
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ public Dataset(CreatorClient client)
+ {
+ if (client == null)
+ {
+ throw new System.ArgumentNullException("client");
+ }
+ Client = client;
+ }
+
+ ///
+ /// Gets a reference to the CreatorClient
+ ///
+ public CreatorClient Client { get; private set; }
+
+ ///
+ /// **Applies to:** see pricing [tiers](https://aka.ms/AzureMapsPricingTier).
+ ///
+ /// Creator makes it possible to develop applications based on your private
+ /// indoor map data using Azure Maps API and SDK.
+ /// [This](https://docs.microsoft.com/azure/azure-maps/creator-indoor-maps)
+ /// article introduces concepts and tools that apply to Azure Maps Creator.
+ ///
+ /// This API allows the caller to create a dataset from data that was uploaded
+ /// to the Azure Maps Data Service and converted using the Azure Maps
+ /// Conversion Service.
+ ///
+ /// You can use this API in a scenario like uploading a DWG zip package for a
+ /// building, converting the zip package using the Azure Maps Conversion
+ /// Service, and creating a dataset from the converted zip package. The created
+ /// dataset can be used to create tilesets using the Azure Maps Tileset Service
+ /// and can be queried via the Azure Maps WFS Service.
+ ///
+ /// ### Submit Create Request
+ ///
+ /// To create your dataset, you will use a `POST` request where the
+ /// `conversionId` query parameter is an ID that represents the converted DWG
+ /// zip package, the `datasetId` parameter will be the ID of a previously
+ /// created dataset to append with the current dataset and, optionally, the
+ /// `description` query parameter will contain a description (if description is
+ /// not provided a default description will be given).
+ ///
+ /// The Create API is a [long-running
+ /// request](https://aka.ms/am-creator-lrt-v2).
+ ///
+ ///
+ /// The unique ID used to create the dataset. The `conversionId` must have been
+ /// obtained from a successful call to the Conversion Service [Convert
+ /// API](https://docs.microsoft.com/en-us/rest/api/maps/v2/conversion/convert)
+ /// and may be provided with multiple query parameters with same name (if more
+ /// than one is provided).
+ ///
+ ///
+ /// The ID for the dataset to append with. The dataset must originate from a
+ /// previous dataset creation call that matches the datasetId
+ ///
+ ///
+ /// The description to be given to the dataset.
+ ///
+ ///
+ /// 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> CreateWithHttpMessagesAsync(string conversionId, string datasetId = default(string), string descriptionDataset = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
+ {
+ if (Client.Geography == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.Geography");
+ }
+ if (conversionId == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "conversionId");
+ }
+ string apiVersion = "2.0";
+ // Tracing
+ bool _shouldTrace = ServiceClientTracing.IsEnabled;
+ string _invocationId = null;
+ if (_shouldTrace)
+ {
+ _invocationId = ServiceClientTracing.NextInvocationId.ToString();
+ Dictionary tracingParameters = new Dictionary();
+ tracingParameters.Add("apiVersion", apiVersion);
+ tracingParameters.Add("conversionId", conversionId);
+ tracingParameters.Add("datasetId", datasetId);
+ tracingParameters.Add("descriptionDataset", descriptionDataset);
+ tracingParameters.Add("cancellationToken", cancellationToken);
+ ServiceClientTracing.Enter(_invocationId, this, "Create", tracingParameters);
+ }
+ // Construct URL
+ var _baseUrl = Client.BaseUri;
+ var _url = _baseUrl + (_baseUrl.EndsWith("/") ? "" : "/") + "datasets";
+ _url = _url.Replace("{geography}", System.Uri.EscapeDataString(Client.Geography));
+ List _queryParameters = new List();
+ if (apiVersion != null)
+ {
+ _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion)));
+ }
+ if (conversionId != null)
+ {
+ _queryParameters.Add(string.Format("conversionId={0}", System.Uri.EscapeDataString(conversionId)));
+ }
+ if (datasetId != null)
+ {
+ _queryParameters.Add(string.Format("datasetId={0}", System.Uri.EscapeDataString(datasetId)));
+ }
+ if (descriptionDataset != null)
+ {
+ _queryParameters.Add(string.Format("description={0}", System.Uri.EscapeDataString(descriptionDataset)));
+ }
+ if (_queryParameters.Count > 0)
+ {
+ _url += "?" + string.Join("&", _queryParameters);
+ }
+ // Create HTTP transport objects
+ var _httpRequest = new HttpRequestMessage();
+ HttpResponseMessage _httpResponse = null;
+ _httpRequest.Method = new HttpMethod("POST");
+ _httpRequest.RequestUri = new System.Uri(_url);
+ // Set Headers
+
+
+ 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 && (int)_statusCode != 202)
+ {
+ var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode));
+ try
+ {
+ _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
+ ErrorResponse _errorBody = Microsoft.Rest.Serialization.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 = Microsoft.Rest.Serialization.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);
+ }
+ }
+ try
+ {
+ _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(JsonSerializer.Create(Client.DeserializationSettings));
+ }
+ catch (JsonException ex)
+ {
+ _httpRequest.Dispose();
+ if (_httpResponse != null)
+ {
+ _httpResponse.Dispose();
+ }
+ throw new SerializationException("Unable to deserialize the headers.", _httpResponse.GetHeadersAsJson().ToString(), ex);
+ }
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.Exit(_invocationId, _result);
+ }
+ return _result;
+ }
+
+ ///
+ /// **Applies to:** see pricing [tiers](https://aka.ms/AzureMapsPricingTier).
+ ///
+ /// Creator makes it possible to develop applications based on your private
+ /// indoor map data using Azure Maps API and SDK.
+ /// [This](https://docs.microsoft.com/azure/azure-maps/creator-indoor-maps)
+ /// article introduces concepts and tools that apply to Azure Maps Creator.
+ ///
+ /// This API allows the caller to fetch a list of all previously successfully
+ /// created datasets.
+ ///
+ /// ### Submit List Request
+ ///
+ /// To list all your datasets, you will issue a `GET` request with no
+ /// additional parameters.
+ ///
+ ///
+ /// ### List Data Response
+ ///
+ /// The List API returns the complete list of all datasets in `json` format.
+ /// The response contains the following fields (if they are not null or empty):
+ /// > created - The timestamp the dataset was created.
+ /// > datasetId - The id for the dataset.
+ /// > description - The description for the dataset.
+ /// > datasetSources - The source data that was used when the create request
+ /// was issued.
+ /// > ontology - The source
+ /// [ontology](https://docs.microsoft.com/en-us/azure/azure-maps/creator-facility-ontology)
+ /// that was used in the conversion service for the input data.<br/>
+ ///
+ /// The `datasetSources` describes the source data that was used when the
+ /// create request was issued and contains the following elements (if they are
+ /// not null or empty):
+ ///
+ /// > conversionIds - The list of `conversionId` (null if none were
+ /// provided).
+ /// > appendDatasetId - The `datasetId` that was used for an append
+ /// operation (null if none was used).
+ /// >featureCounts - The counts for each feature type in the
+ /// dataset.<br/>
+ ///
+ /// Here's a sample response returning the `timestamp`, `datasetId`,
+ /// `description`, `datasetSources`, and `ontology` of 3 dataset resources:
+ ///
+ ///
+ /// ```json
+ /// {
+ /// "datasets": [
+ /// {
+ /// "timestamp": "2020-01-01T22:50:48.123Z",
+ /// "datasetId": "f6495f62-94f8-0ec2-c252-45626f82fcb2",
+ /// "description": "Some description or comment for the dataset.",
+ /// "datasetSources": {
+ /// "conversionIds": [
+ /// "15d21452-c9bb-27b6-5e79-743ca5c3205d"
+ /// ], },
+ /// "ontology": "facility-2.0",
+ /// "featureCounts": {
+ /// "directoryInfo": 2,
+ /// "category": 10,
+ /// "facility": 1,
+ /// "level": 3,
+ /// "unit": 183,
+ /// "zone": 3,
+ /// "verticalPenetration": 6,
+ /// "opening": 48,
+ /// "areaElement": 108
+ /// }
+ /// },
+ /// {
+ /// "timestamp": "2020-01-01T22:57:53.123Z",
+ /// "datasetId": "8b1288fa-1958-4a2b-b68e-13a7i5af7d7c",
+ /// "description": "Create from upload
+ /// '0c1288fa-2058-4a1b-b68d-13a5f5af7d7c'.",
+ /// "datasetSources": {
+ /// "conversionIds": [
+ /// "0c1288fa-2058-4a1b-b68d-13a5f5af7d7c"
+ /// ],
+ /// "appendDatasetId": "46d1edb6-d29e-4786-9589-dbd4efd7a977"
+ /// },
+ /// "ontology": "facility-2.0",
+ /// "featureCounts": {
+ /// "directoryInfo": 2,
+ /// "category": 10,
+ /// "facility": 1,
+ /// "level": 3,
+ /// "unit": 183,
+ /// "zone": 3,
+ /// "verticalPenetration": 6,
+ /// "opening": 48,
+ /// "areaElement": 108
+ /// }
+ /// }
+ /// ]
+ /// }
+ /// ```
+ ///
+ ///
+ /// 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> ListWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
+ {
+ if (Client.Geography == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.Geography");
+ }
+ string apiVersion = "2.0";
+ // Tracing
+ bool _shouldTrace = ServiceClientTracing.IsEnabled;
+ string _invocationId = null;
+ if (_shouldTrace)
+ {
+ _invocationId = ServiceClientTracing.NextInvocationId.ToString();
+ Dictionary tracingParameters = new Dictionary();
+ tracingParameters.Add("apiVersion", apiVersion);
+ tracingParameters.Add("cancellationToken", cancellationToken);
+ ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters);
+ }
+ // Construct URL
+ var _baseUrl = Client.BaseUri;
+ var _url = _baseUrl + (_baseUrl.EndsWith("/") ? "" : "/") + "datasets";
+ _url = _url.Replace("{geography}", System.Uri.EscapeDataString(Client.Geography));
+ List _queryParameters = new List();
+ if (apiVersion != null)
+ {
+ _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(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 (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 = Microsoft.Rest.Serialization.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 = Microsoft.Rest.Serialization.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;
+ }
+
+ ///
+ /// **Applies to:** see pricing [tiers](https://aka.ms/AzureMapsPricingTier).
+ ///
+ /// Creator makes it possible to develop applications based on your private
+ /// indoor map data using Azure Maps API and SDK.
+ /// [This](https://docs.microsoft.com/azure/azure-maps/creator-indoor-maps)
+ /// article introduces concepts and tools that apply to Azure Maps Creator.
+ ///
+ /// This API allows the caller to fetch a previously successfully created
+ /// dataset.
+ ///
+ /// ### Submit Get Details Request
+ ///
+ /// To get the details for a previously created dataset, you will issue a `GET`
+ /// request with the `datasetId` in the path.
+ ///
+ /// ### Get Details Response
+ ///
+ /// The Get Details API returns the details for a dataset in `json` format. The
+ /// response contains the following fields (if they are not null or empty):
+ /// > created - The timestamp the dataset was created.
+ /// > datasetId - The id for the dataset.
+ /// > description - The description for the dataset.
+ /// > datasetSources - The source data that was used when the create request
+ /// was issued.
+ /// > ontology - The source
+ /// [ontology](https://docs.microsoft.com/en-us/azure/azure-maps/creator-facility-ontology)
+ /// that was used in the conversion service for the input data.<br/>
+ ///
+ /// The `datasetSources` describes the source data that was used when the
+ /// create request was issued and contains the following elements (if they are
+ /// not null or empty):
+ /// > conversionIds - The list of `conversionId` (null if none were
+ /// provided).
+ /// > appendDatasetId - The `datasetId` that was used for an append
+ /// operation (null if none was used).
+ /// >featureCounts - The counts for each feature type in the
+ /// dataset.<br/>
+ ///
+ /// Here's a sample response returning the `timestamp`, `datasetId`,
+ /// `description`, `datasetSources`, and `ontology` of a dataset resource:
+ ///
+ /// ```json
+ /// {
+ /// "timestamp": "2020-01-01T22:50:48.123Z",
+ /// "datasetId": "f6495f62-94f8-0ec2-c252-45626f82fcb2",
+ /// "description": "Some description or comment for the dataset.",
+ /// "datasetSources": {
+ /// "conversionIds": [
+ /// "15d21452-c9bb-27b6-5e79-743ca5c3205d"
+ /// ],
+ /// },
+ /// "ontology": "facility-2.0",
+ /// "featureCounts": {
+ /// "directoryInfo": 2,
+ /// "category": 10,
+ /// "facility": 1,
+ /// "level": 3,
+ /// "unit": 183,
+ /// "zone": 3,
+ /// "verticalPenetration": 6,
+ /// "opening": 48,
+ /// "areaElement": 108
+ /// }
+ /// }
+ /// ```
+ ///
+ ///
+ /// The identifier for the dataset to query from.
+ ///
+ ///
+ /// 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> GetWithHttpMessagesAsync(string datasetId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
+ {
+ if (Client.Geography == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.Geography");
+ }
+ if (datasetId == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "datasetId");
+ }
+ string apiVersion = "2.0";
+ // Tracing
+ bool _shouldTrace = ServiceClientTracing.IsEnabled;
+ string _invocationId = null;
+ if (_shouldTrace)
+ {
+ _invocationId = ServiceClientTracing.NextInvocationId.ToString();
+ Dictionary tracingParameters = new Dictionary();
+ tracingParameters.Add("datasetId", datasetId);
+ tracingParameters.Add("apiVersion", apiVersion);
+ tracingParameters.Add("cancellationToken", cancellationToken);
+ ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters);
+ }
+ // Construct URL
+ var _baseUrl = Client.BaseUri;
+ var _url = _baseUrl + (_baseUrl.EndsWith("/") ? "" : "/") + "datasets/{datasetId}";
+ _url = _url.Replace("{geography}", System.Uri.EscapeDataString(Client.Geography));
+ _url = _url.Replace("{datasetId}", System.Uri.EscapeDataString(datasetId));
+ List _queryParameters = new List();
+ if (apiVersion != null)
+ {
+ _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(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 (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 = Microsoft.Rest.Serialization.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 = Microsoft.Rest.Serialization.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;
+ }
+
+ ///
+ /// **Applies to:** see pricing [tiers](https://aka.ms/AzureMapsPricingTier).
+ ///
+ /// Creator makes it possible to develop applications based on your private
+ /// indoor map data using Azure Maps API and SDK.
+ /// [This](https://docs.microsoft.com/azure/azure-maps/creator-indoor-maps)
+ /// article introduces concepts and tools that apply to Azure Maps Creator.
+ ///
+ /// You can also use this API to delete old/unused datasets to create space for
+ /// new Creator content.
+ ///
+ /// ### Submit Delete Request
+ ///
+ /// To delete your content you will issue a `DELETE` request where the path
+ /// will contain the `datasetId` of the dataset to delete.
+ ///
+ ///
+ /// The identifier for the dataset to query from.
+ ///
+ ///
+ /// Headers that will be added to request.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ ///
+ /// Thrown when the operation returned an invalid status code
+ ///
+ ///
+ /// 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 DeleteWithHttpMessagesAsync(string datasetId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
+ {
+ if (Client.Geography == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.Geography");
+ }
+ if (datasetId == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "datasetId");
+ }
+ string apiVersion = "2.0";
+ // Tracing
+ bool _shouldTrace = ServiceClientTracing.IsEnabled;
+ string _invocationId = null;
+ if (_shouldTrace)
+ {
+ _invocationId = ServiceClientTracing.NextInvocationId.ToString();
+ Dictionary tracingParameters = new Dictionary();
+ tracingParameters.Add("apiVersion", apiVersion);
+ tracingParameters.Add("datasetId", datasetId);
+ tracingParameters.Add("cancellationToken", cancellationToken);
+ ServiceClientTracing.Enter(_invocationId, this, "Delete", tracingParameters);
+ }
+ // Construct URL
+ var _baseUrl = Client.BaseUri;
+ var _url = _baseUrl + (_baseUrl.EndsWith("/") ? "" : "/") + "datasets/{datasetId}";
+ _url = _url.Replace("{geography}", System.Uri.EscapeDataString(Client.Geography));
+ _url = _url.Replace("{datasetId}", System.Uri.EscapeDataString(datasetId));
+ List _queryParameters = new List();
+ if (apiVersion != null)
+ {
+ _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion)));
+ }
+ if (_queryParameters.Count > 0)
+ {
+ _url += "?" + string.Join("&", _queryParameters);
+ }
+ // Create HTTP transport objects
+ var _httpRequest = new HttpRequestMessage();
+ HttpResponseMessage _httpResponse = null;
+ _httpRequest.Method = new HttpMethod("DELETE");
+ _httpRequest.RequestUri = new System.Uri(_url);
+ // Set Headers
+
+
+ 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 != 204)
+ {
+ var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode));
+ try
+ {
+ _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
+ ErrorResponse _errorBody = Microsoft.Rest.Serialization.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;
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.Exit(_invocationId, _result);
+ }
+ return _result;
+ }
+
+ ///
+ /// This API allows the caller to view the current progress of a dataset
+ /// operation and the path is obtained from a call to the Create API.
+ ///
+ /// ### Submit Operations Request
+ ///
+ /// To view the current progress of a dataset operation, you will use a `GET`
+ /// request where the `operationId` given the path is the ID that represents
+ /// the operation.
+ ///
+ /// ### Operation Response
+ ///
+ /// While in progress, a `200-OK` http status code will be returned with no
+ /// extra headers. If the operation succeeds, a `200-OK` http status code with
+ /// Resource-Location header will be returned.
+ ///
+ ///
+ /// The ID to query the status for the dataset create/import request.
+ ///
+ ///
+ /// 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> GetOperationWithHttpMessagesAsync(string operationId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
+ {
+ if (Client.Geography == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.Geography");
+ }
+ if (operationId == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "operationId");
+ }
+ string apiVersion = "2.0";
+ // Tracing
+ bool _shouldTrace = ServiceClientTracing.IsEnabled;
+ string _invocationId = null;
+ if (_shouldTrace)
+ {
+ _invocationId = ServiceClientTracing.NextInvocationId.ToString();
+ Dictionary tracingParameters = new Dictionary();
+ tracingParameters.Add("apiVersion", apiVersion);
+ tracingParameters.Add("operationId", operationId);
+ tracingParameters.Add("cancellationToken", cancellationToken);
+ ServiceClientTracing.Enter(_invocationId, this, "GetOperation", tracingParameters);
+ }
+ // Construct URL
+ var _baseUrl = Client.BaseUri;
+ var _url = _baseUrl + (_baseUrl.EndsWith("/") ? "" : "/") + "datasets/operations/{operationId}";
+ _url = _url.Replace("{geography}", System.Uri.EscapeDataString(Client.Geography));
+ _url = _url.Replace("{operationId}", System.Uri.EscapeDataString(operationId));
+ List _queryParameters = new List();
+ if (apiVersion != null)
+ {
+ _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(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 (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 = Microsoft.Rest.Serialization.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 = Microsoft.Rest.Serialization.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);
+ }
+ }
+ try
+ {
+ _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(JsonSerializer.Create(Client.DeserializationSettings));
+ }
+ catch (JsonException ex)
+ {
+ _httpRequest.Dispose();
+ if (_httpResponse != null)
+ {
+ _httpResponse.Dispose();
+ }
+ throw new SerializationException("Unable to deserialize the headers.", _httpResponse.GetHeadersAsJson().ToString(), ex);
+ }
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.Exit(_invocationId, _result);
+ }
+ return _result;
+ }
+
+ }
+}
diff --git a/sdk/maps/Azure.Maps.Creator/src/Generated/DatasetExtensions.cs b/sdk/maps/Azure.Maps.Creator/src/Generated/DatasetExtensions.cs
new file mode 100644
index 000000000000..00767a24032f
--- /dev/null
+++ b/sdk/maps/Azure.Maps.Creator/src/Generated/DatasetExtensions.cs
@@ -0,0 +1,339 @@
+//
+// 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.Creator
+{
+ using Models;
+ using System.Threading;
+ using System.Threading.Tasks;
+
+ ///
+ /// Extension methods for Dataset.
+ ///
+ public static partial class DatasetExtensions
+ {
+ ///
+ /// **Applies to:** see pricing [tiers](https://aka.ms/AzureMapsPricingTier).
+ ///
+ /// Creator makes it possible to develop applications based on your private
+ /// indoor map data using Azure Maps API and SDK.
+ /// [This](https://docs.microsoft.com/azure/azure-maps/creator-indoor-maps)
+ /// article introduces concepts and tools that apply to Azure Maps Creator.
+ ///
+ /// This API allows the caller to create a dataset from data that was uploaded
+ /// to the Azure Maps Data Service and converted using the Azure Maps
+ /// Conversion Service.
+ ///
+ /// You can use this API in a scenario like uploading a DWG zip package for a
+ /// building, converting the zip package using the Azure Maps Conversion
+ /// Service, and creating a dataset from the converted zip package. The created
+ /// dataset can be used to create tilesets using the Azure Maps Tileset Service
+ /// and can be queried via the Azure Maps WFS Service.
+ ///
+ /// ### Submit Create Request
+ ///
+ /// To create your dataset, you will use a `POST` request where the
+ /// `conversionId` query parameter is an ID that represents the converted DWG
+ /// zip package, the `datasetId` parameter will be the ID of a previously
+ /// created dataset to append with the current dataset and, optionally, the
+ /// `description` query parameter will contain a description (if description is
+ /// not provided a default description will be given).
+ ///
+ /// The Create API is a [long-running
+ /// request](https://aka.ms/am-creator-lrt-v2).
+ ///
+ ///
+ /// The operations group for this extension method.
+ ///
+ ///
+ /// The unique ID used to create the dataset. The `conversionId` must have been
+ /// obtained from a successful call to the Conversion Service [Convert
+ /// API](https://docs.microsoft.com/en-us/rest/api/maps/v2/conversion/convert)
+ /// and may be provided with multiple query parameters with same name (if more
+ /// than one is provided).
+ ///
+ ///
+ /// The ID for the dataset to append with. The dataset must originate from a
+ /// previous dataset creation call that matches the datasetId
+ ///
+ ///
+ /// The description to be given to the dataset.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ public static async Task CreateAsync(this IDataset operations, string conversionId, string datasetId = default(string), string descriptionDataset = default(string), CancellationToken cancellationToken = default(CancellationToken))
+ {
+ using (var _result = await operations.CreateWithHttpMessagesAsync(conversionId, datasetId, descriptionDataset, null, cancellationToken).ConfigureAwait(false))
+ {
+ return _result.Body;
+ }
+ }
+
+ ///
+ /// **Applies to:** see pricing [tiers](https://aka.ms/AzureMapsPricingTier).
+ ///
+ /// Creator makes it possible to develop applications based on your private
+ /// indoor map data using Azure Maps API and SDK.
+ /// [This](https://docs.microsoft.com/azure/azure-maps/creator-indoor-maps)
+ /// article introduces concepts and tools that apply to Azure Maps Creator.
+ ///
+ /// This API allows the caller to fetch a list of all previously successfully
+ /// created datasets.
+ ///
+ /// ### Submit List Request
+ ///
+ /// To list all your datasets, you will issue a `GET` request with no
+ /// additional parameters.
+ ///
+ ///
+ /// ### List Data Response
+ ///
+ /// The List API returns the complete list of all datasets in `json` format.
+ /// The response contains the following fields (if they are not null or empty):
+ /// > created - The timestamp the dataset was created.
+ /// > datasetId - The id for the dataset.
+ /// > description - The description for the dataset.
+ /// > datasetSources - The source data that was used when the create request
+ /// was issued.
+ /// > ontology - The source
+ /// [ontology](https://docs.microsoft.com/en-us/azure/azure-maps/creator-facility-ontology)
+ /// that was used in the conversion service for the input data.<br/>
+ ///
+ /// The `datasetSources` describes the source data that was used when the
+ /// create request was issued and contains the following elements (if they are
+ /// not null or empty):
+ ///
+ /// > conversionIds - The list of `conversionId` (null if none were
+ /// provided).
+ /// > appendDatasetId - The `datasetId` that was used for an append
+ /// operation (null if none was used).
+ /// >featureCounts - The counts for each feature type in the
+ /// dataset.<br/>
+ ///
+ /// Here's a sample response returning the `timestamp`, `datasetId`,
+ /// `description`, `datasetSources`, and `ontology` of 3 dataset resources:
+ ///
+ ///
+ /// ```json
+ /// {
+ /// "datasets": [
+ /// {
+ /// "timestamp": "2020-01-01T22:50:48.123Z",
+ /// "datasetId": "f6495f62-94f8-0ec2-c252-45626f82fcb2",
+ /// "description": "Some description or comment for the dataset.",
+ /// "datasetSources": {
+ /// "conversionIds": [
+ /// "15d21452-c9bb-27b6-5e79-743ca5c3205d"
+ /// ], },
+ /// "ontology": "facility-2.0",
+ /// "featureCounts": {
+ /// "directoryInfo": 2,
+ /// "category": 10,
+ /// "facility": 1,
+ /// "level": 3,
+ /// "unit": 183,
+ /// "zone": 3,
+ /// "verticalPenetration": 6,
+ /// "opening": 48,
+ /// "areaElement": 108
+ /// }
+ /// },
+ /// {
+ /// "timestamp": "2020-01-01T22:57:53.123Z",
+ /// "datasetId": "8b1288fa-1958-4a2b-b68e-13a7i5af7d7c",
+ /// "description": "Create from upload
+ /// '0c1288fa-2058-4a1b-b68d-13a5f5af7d7c'.",
+ /// "datasetSources": {
+ /// "conversionIds": [
+ /// "0c1288fa-2058-4a1b-b68d-13a5f5af7d7c"
+ /// ],
+ /// "appendDatasetId": "46d1edb6-d29e-4786-9589-dbd4efd7a977"
+ /// },
+ /// "ontology": "facility-2.0",
+ /// "featureCounts": {
+ /// "directoryInfo": 2,
+ /// "category": 10,
+ /// "facility": 1,
+ /// "level": 3,
+ /// "unit": 183,
+ /// "zone": 3,
+ /// "verticalPenetration": 6,
+ /// "opening": 48,
+ /// "areaElement": 108
+ /// }
+ /// }
+ /// ]
+ /// }
+ /// ```
+ ///
+ ///
+ /// The operations group for this extension method.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ public static async Task ListAsync(this IDataset operations, CancellationToken cancellationToken = default(CancellationToken))
+ {
+ using (var _result = await operations.ListWithHttpMessagesAsync(null, cancellationToken).ConfigureAwait(false))
+ {
+ return _result.Body;
+ }
+ }
+
+ ///
+ /// **Applies to:** see pricing [tiers](https://aka.ms/AzureMapsPricingTier).
+ ///
+ /// Creator makes it possible to develop applications based on your private
+ /// indoor map data using Azure Maps API and SDK.
+ /// [This](https://docs.microsoft.com/azure/azure-maps/creator-indoor-maps)
+ /// article introduces concepts and tools that apply to Azure Maps Creator.
+ ///
+ /// This API allows the caller to fetch a previously successfully created
+ /// dataset.
+ ///
+ /// ### Submit Get Details Request
+ ///
+ /// To get the details for a previously created dataset, you will issue a `GET`
+ /// request with the `datasetId` in the path.
+ ///
+ /// ### Get Details Response
+ ///
+ /// The Get Details API returns the details for a dataset in `json` format. The
+ /// response contains the following fields (if they are not null or empty):
+ /// > created - The timestamp the dataset was created.
+ /// > datasetId - The id for the dataset.
+ /// > description - The description for the dataset.
+ /// > datasetSources - The source data that was used when the create request
+ /// was issued.
+ /// > ontology - The source
+ /// [ontology](https://docs.microsoft.com/en-us/azure/azure-maps/creator-facility-ontology)
+ /// that was used in the conversion service for the input data.<br/>
+ ///
+ /// The `datasetSources` describes the source data that was used when the
+ /// create request was issued and contains the following elements (if they are
+ /// not null or empty):
+ /// > conversionIds - The list of `conversionId` (null if none were
+ /// provided).
+ /// > appendDatasetId - The `datasetId` that was used for an append
+ /// operation (null if none was used).
+ /// >featureCounts - The counts for each feature type in the
+ /// dataset.<br/>
+ ///
+ /// Here's a sample response returning the `timestamp`, `datasetId`,
+ /// `description`, `datasetSources`, and `ontology` of a dataset resource:
+ ///
+ /// ```json
+ /// {
+ /// "timestamp": "2020-01-01T22:50:48.123Z",
+ /// "datasetId": "f6495f62-94f8-0ec2-c252-45626f82fcb2",
+ /// "description": "Some description or comment for the dataset.",
+ /// "datasetSources": {
+ /// "conversionIds": [
+ /// "15d21452-c9bb-27b6-5e79-743ca5c3205d"
+ /// ],
+ /// },
+ /// "ontology": "facility-2.0",
+ /// "featureCounts": {
+ /// "directoryInfo": 2,
+ /// "category": 10,
+ /// "facility": 1,
+ /// "level": 3,
+ /// "unit": 183,
+ /// "zone": 3,
+ /// "verticalPenetration": 6,
+ /// "opening": 48,
+ /// "areaElement": 108
+ /// }
+ /// }
+ /// ```
+ ///
+ ///
+ /// The operations group for this extension method.
+ ///
+ ///
+ /// The identifier for the dataset to query from.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ public static async Task GetAsync(this IDataset operations, string datasetId, CancellationToken cancellationToken = default(CancellationToken))
+ {
+ using (var _result = await operations.GetWithHttpMessagesAsync(datasetId, null, cancellationToken).ConfigureAwait(false))
+ {
+ return _result.Body;
+ }
+ }
+
+ ///
+ /// **Applies to:** see pricing [tiers](https://aka.ms/AzureMapsPricingTier).
+ ///
+ /// Creator makes it possible to develop applications based on your private
+ /// indoor map data using Azure Maps API and SDK.
+ /// [This](https://docs.microsoft.com/azure/azure-maps/creator-indoor-maps)
+ /// article introduces concepts and tools that apply to Azure Maps Creator.
+ ///
+ /// You can also use this API to delete old/unused datasets to create space for
+ /// new Creator content.
+ ///
+ /// ### Submit Delete Request
+ ///
+ /// To delete your content you will issue a `DELETE` request where the path
+ /// will contain the `datasetId` of the dataset to delete.
+ ///
+ ///
+ /// The operations group for this extension method.
+ ///
+ ///
+ /// The identifier for the dataset to query from.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ public static async Task DeleteAsync(this IDataset operations, string datasetId, CancellationToken cancellationToken = default(CancellationToken))
+ {
+ (await operations.DeleteWithHttpMessagesAsync(datasetId, null, cancellationToken).ConfigureAwait(false)).Dispose();
+ }
+
+ ///
+ /// This API allows the caller to view the current progress of a dataset
+ /// operation and the path is obtained from a call to the Create API.
+ ///
+ /// ### Submit Operations Request
+ ///
+ /// To view the current progress of a dataset operation, you will use a `GET`
+ /// request where the `operationId` given the path is the ID that represents
+ /// the operation.
+ ///
+ /// ### Operation Response
+ ///
+ /// While in progress, a `200-OK` http status code will be returned with no
+ /// extra headers. If the operation succeeds, a `200-OK` http status code with
+ /// Resource-Location header will be returned.
+ ///
+ ///
+ /// The operations group for this extension method.
+ ///
+ ///
+ /// The ID to query the status for the dataset create/import request.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ public static async Task GetOperationAsync(this IDataset operations, string operationId, CancellationToken cancellationToken = default(CancellationToken))
+ {
+ using (var _result = await operations.GetOperationWithHttpMessagesAsync(operationId, null, cancellationToken).ConfigureAwait(false))
+ {
+ return _result.Body;
+ }
+ }
+
+ }
+}
diff --git a/sdk/maps/Azure.Maps.Creator/src/Generated/FeatureState.cs b/sdk/maps/Azure.Maps.Creator/src/Generated/FeatureState.cs
new file mode 100644
index 000000000000..26e1731d9ab0
--- /dev/null
+++ b/sdk/maps/Azure.Maps.Creator/src/Generated/FeatureState.cs
@@ -0,0 +1,1463 @@
+//
+// 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.Creator
+{
+ using Microsoft.Rest;
+ 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;
+
+ ///
+ /// FeatureState operations.
+ ///
+ public partial class FeatureState : IServiceOperations, IFeatureState
+ {
+ ///
+ /// Initializes a new instance of the FeatureState class.
+ ///
+ ///
+ /// Reference to the service client.
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ public FeatureState(CreatorClient client)
+ {
+ if (client == null)
+ {
+ throw new System.ArgumentNullException("client");
+ }
+ Client = client;
+ }
+
+ ///
+ /// Gets a reference to the CreatorClient
+ ///
+ public CreatorClient Client { get; private set; }
+
+ ///
+ /// **Applies to:** see pricing [tiers](https://aka.ms/AzureMapsPricingTier).
+ ///
+ /// Creator makes it possible to develop applications based on your private
+ /// indoor map data using Azure Maps API and SDK.
+ /// [This](https://docs.microsoft.com/azure/azure-maps/creator-indoor-maps)
+ /// article introduces concepts and tools that apply to Azure Maps Creator.
+ ///
+ /// This POST API allows the user to create a new Stateset and define stateset
+ /// style using request body.
+ ///
+ /// Creator makes it possible to develop applications based on your private
+ /// indoor map data using Azure Maps API and SDK. The Feature State API is part
+ /// of Creator.
+ ///
+ /// The Feature State service allows the user to update the states of a feature
+ /// and query them to be used in other services. The dynamic properties of a
+ /// feature that don't belong to the dataset are referred to as *states* here.
+ ///
+ /// This Feature State service pivot on the Stateset. Like Tileset, Stateset
+ /// encapsulates the storage mechanism for feature states for a dataset.
+ ///
+ /// Once the stateset is created, users can use that statesetId to post feature
+ /// state updates and retrieve the current feature states. A feature can have
+ /// only one state at a given point in time.
+ ///
+ /// Feature state is defined by the key name, value and the timestamp. When a
+ /// feature state update is posted to Azure Maps, the state value gets updated
+ /// only if the provided state’s timestamp is later than the stored timestamp.
+ ///
+ /// Azure Maps MapControl provides a way to use these feature states to style
+ /// the features. Please refer to the [State Tile
+ /// documentation](https://docs.microsoft.com/en-us/rest/api/maps/render/get-map-state-tile-preview)
+ /// for more information.
+ ///
+ ///
+ /// The datasetId must have been obtained from a successful [Dataset Create
+ /// API](https://docs.microsoft.com/en-us/rest/api/maps/v2/dataset/create)
+ /// call.
+ ///
+ ///
+ /// The stateset style JSON data.
+ ///
+ ///
+ /// Description for the stateset. Max length allowed is 1000.
+ ///
+ ///
+ /// 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> CreateStatesetWithHttpMessagesAsync(string datasetId, StylesObject statesetCreateRequestBody, string description = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
+ {
+ if (Client.Geography == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.Geography");
+ }
+ if (datasetId == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "datasetId");
+ }
+ if (statesetCreateRequestBody == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "statesetCreateRequestBody");
+ }
+ string apiVersion = "2.0";
+ // Tracing
+ bool _shouldTrace = ServiceClientTracing.IsEnabled;
+ string _invocationId = null;
+ if (_shouldTrace)
+ {
+ _invocationId = ServiceClientTracing.NextInvocationId.ToString();
+ Dictionary tracingParameters = new Dictionary();
+ tracingParameters.Add("apiVersion", apiVersion);
+ tracingParameters.Add("datasetId", datasetId);
+ tracingParameters.Add("description", description);
+ tracingParameters.Add("statesetCreateRequestBody", statesetCreateRequestBody);
+ tracingParameters.Add("cancellationToken", cancellationToken);
+ ServiceClientTracing.Enter(_invocationId, this, "CreateStateset", tracingParameters);
+ }
+ // Construct URL
+ var _baseUrl = Client.BaseUri;
+ var _url = _baseUrl + (_baseUrl.EndsWith("/") ? "" : "/") + "featureStateSets";
+ _url = _url.Replace("{geography}", System.Uri.EscapeDataString(Client.Geography));
+ List _queryParameters = new List();
+ if (apiVersion != null)
+ {
+ _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion)));
+ }
+ if (datasetId != null)
+ {
+ _queryParameters.Add(string.Format("datasetId={0}", System.Uri.EscapeDataString(datasetId)));
+ }
+ if (description != null)
+ {
+ _queryParameters.Add(string.Format("description={0}", System.Uri.EscapeDataString(description)));
+ }
+ if (_queryParameters.Count > 0)
+ {
+ _url += "?" + string.Join("&", _queryParameters);
+ }
+ // Create HTTP transport objects
+ var _httpRequest = new HttpRequestMessage();
+ HttpResponseMessage _httpResponse = null;
+ _httpRequest.Method = new HttpMethod("POST");
+ _httpRequest.RequestUri = new System.Uri(_url);
+ // Set Headers
+
+
+ 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;
+ if(statesetCreateRequestBody != null)
+ {
+ _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(statesetCreateRequestBody, Client.SerializationSettings);
+ _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8);
+ _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8");
+ }
+ // 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 = Microsoft.Rest.Serialization.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 = Microsoft.Rest.Serialization.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;
+ }
+
+ ///
+ /// **Applies to:** see pricing [tiers](https://aka.ms/AzureMapsPricingTier).
+ ///
+ /// Creator makes it possible to develop applications based on your private
+ /// indoor map data using Azure Maps API and SDK.
+ /// [This](https://docs.microsoft.com/azure/azure-maps/creator-indoor-maps)
+ /// article introduces concepts and tools that apply to Azure Maps Creator.
+ ///
+ /// This API allows the caller to fetch a list of all previously successfully
+ /// created statesets.
+ ///
+ ///
+ /// 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> ListStatesetWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
+ {
+ if (Client.Geography == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.Geography");
+ }
+ string apiVersion = "2.0";
+ // Tracing
+ bool _shouldTrace = ServiceClientTracing.IsEnabled;
+ string _invocationId = null;
+ if (_shouldTrace)
+ {
+ _invocationId = ServiceClientTracing.NextInvocationId.ToString();
+ Dictionary tracingParameters = new Dictionary();
+ tracingParameters.Add("apiVersion", apiVersion);
+ tracingParameters.Add("cancellationToken", cancellationToken);
+ ServiceClientTracing.Enter(_invocationId, this, "ListStateset", tracingParameters);
+ }
+ // Construct URL
+ var _baseUrl = Client.BaseUri;
+ var _url = _baseUrl + (_baseUrl.EndsWith("/") ? "" : "/") + "featureStateSets";
+ _url = _url.Replace("{geography}", System.Uri.EscapeDataString(Client.Geography));
+ List _queryParameters = new List();
+ if (apiVersion != null)
+ {
+ _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(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 (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 = Microsoft.Rest.Serialization.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 = Microsoft.Rest.Serialization.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;
+ }
+
+ ///
+ /// **Applies to:** see pricing [tiers](https://aka.ms/AzureMapsPricingTier).
+ ///
+ /// Creator makes it possible to develop applications based on your private
+ /// indoor map data using Azure Maps API and SDK.
+ /// [This](https://docs.microsoft.com/azure/azure-maps/creator-indoor-maps)
+ /// article introduces concepts and tools that apply to Azure Maps Creator.
+ ///
+ /// This PUT API allows the user to update the stateset style rules.
+ ///
+ ///
+ /// The stateset id that was created.
+ ///
+ ///
+ /// The stateset style JSON data. Only style rules are allowed to be updated,
+ /// update on keyname and type is not allowed.
+ ///
+ ///
+ /// Headers that will be added to request.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ ///
+ /// Thrown when the operation returned an invalid status code
+ ///
+ ///
+ /// 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 PutStatesetWithHttpMessagesAsync(string statesetId, StylesObject statesetStyleUpdateRequestBody, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
+ {
+ if (Client.Geography == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.Geography");
+ }
+ if (statesetId == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "statesetId");
+ }
+ if (statesetStyleUpdateRequestBody == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "statesetStyleUpdateRequestBody");
+ }
+ string apiVersion = "2.0";
+ // Tracing
+ bool _shouldTrace = ServiceClientTracing.IsEnabled;
+ string _invocationId = null;
+ if (_shouldTrace)
+ {
+ _invocationId = ServiceClientTracing.NextInvocationId.ToString();
+ Dictionary tracingParameters = new Dictionary();
+ tracingParameters.Add("apiVersion", apiVersion);
+ tracingParameters.Add("statesetId", statesetId);
+ tracingParameters.Add("statesetStyleUpdateRequestBody", statesetStyleUpdateRequestBody);
+ tracingParameters.Add("cancellationToken", cancellationToken);
+ ServiceClientTracing.Enter(_invocationId, this, "PutStateset", tracingParameters);
+ }
+ // Construct URL
+ var _baseUrl = Client.BaseUri;
+ var _url = _baseUrl + (_baseUrl.EndsWith("/") ? "" : "/") + "featureStateSets/{statesetId}";
+ _url = _url.Replace("{geography}", System.Uri.EscapeDataString(Client.Geography));
+ _url = _url.Replace("{statesetId}", System.Uri.EscapeDataString(statesetId));
+ List _queryParameters = new List();
+ if (apiVersion != null)
+ {
+ _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion)));
+ }
+ if (_queryParameters.Count > 0)
+ {
+ _url += "?" + string.Join("&", _queryParameters);
+ }
+ // Create HTTP transport objects
+ var _httpRequest = new HttpRequestMessage();
+ HttpResponseMessage _httpResponse = null;
+ _httpRequest.Method = new HttpMethod("PUT");
+ _httpRequest.RequestUri = new System.Uri(_url);
+ // Set Headers
+
+
+ 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;
+ if(statesetStyleUpdateRequestBody != null)
+ {
+ _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(statesetStyleUpdateRequestBody, Client.SerializationSettings);
+ _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8);
+ _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8");
+ }
+ // 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 = Microsoft.Rest.Serialization.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;
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.Exit(_invocationId, _result);
+ }
+ return _result;
+ }
+
+ ///
+ /// **Applies to:** see pricing [tiers](https://aka.ms/AzureMapsPricingTier).
+ ///
+ /// Creator makes it possible to develop applications based on your private
+ /// indoor map data using Azure Maps API and SDK.
+ /// [This](https://docs.microsoft.com/azure/azure-maps/creator-indoor-maps)
+ /// article introduces concepts and tools that apply to Azure Maps Creator.
+ ///
+ /// This DELETE API allows the user to delete the stateset and the associated
+ /// data.
+ ///
+ ///
+ /// The stateset id that was created.
+ ///
+ ///
+ /// Headers that will be added to request.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ ///
+ /// Thrown when the operation returned an invalid status code
+ ///
+ ///
+ /// 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 DeleteStatesetWithHttpMessagesAsync(string statesetId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
+ {
+ if (Client.Geography == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.Geography");
+ }
+ if (statesetId == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "statesetId");
+ }
+ string apiVersion = "2.0";
+ // Tracing
+ bool _shouldTrace = ServiceClientTracing.IsEnabled;
+ string _invocationId = null;
+ if (_shouldTrace)
+ {
+ _invocationId = ServiceClientTracing.NextInvocationId.ToString();
+ Dictionary tracingParameters = new Dictionary();
+ tracingParameters.Add("apiVersion", apiVersion);
+ tracingParameters.Add("statesetId", statesetId);
+ tracingParameters.Add("cancellationToken", cancellationToken);
+ ServiceClientTracing.Enter(_invocationId, this, "DeleteStateset", tracingParameters);
+ }
+ // Construct URL
+ var _baseUrl = Client.BaseUri;
+ var _url = _baseUrl + (_baseUrl.EndsWith("/") ? "" : "/") + "featureStateSets/{statesetId}";
+ _url = _url.Replace("{geography}", System.Uri.EscapeDataString(Client.Geography));
+ _url = _url.Replace("{statesetId}", System.Uri.EscapeDataString(statesetId));
+ List _queryParameters = new List();
+ if (apiVersion != null)
+ {
+ _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion)));
+ }
+ if (_queryParameters.Count > 0)
+ {
+ _url += "?" + string.Join("&", _queryParameters);
+ }
+ // Create HTTP transport objects
+ var _httpRequest = new HttpRequestMessage();
+ HttpResponseMessage _httpResponse = null;
+ _httpRequest.Method = new HttpMethod("DELETE");
+ _httpRequest.RequestUri = new System.Uri(_url);
+ // Set Headers
+
+
+ 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 != 204)
+ {
+ var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode));
+ try
+ {
+ _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
+ ErrorResponse _errorBody = Microsoft.Rest.Serialization.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;
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.Exit(_invocationId, _result);
+ }
+ return _result;
+ }
+
+ ///
+ /// **Applies to:** see pricing [tiers](https://aka.ms/AzureMapsPricingTier).
+ ///
+ /// Creator makes it possible to develop applications based on your private
+ /// indoor map data using Azure Maps API and SDK.
+ /// [This](https://docs.microsoft.com/azure/azure-maps/creator-indoor-maps)
+ /// article introduces concepts and tools that apply to Azure Maps Creator.
+ ///
+ /// This GET API allows the user to get the stateset Information.
+ ///
+ /// The stateset Information includes the datasetId associated to the stateset,
+ /// and the styles of that stateset.
+ ///
+ ///
+ /// The stateset id that was created.
+ ///
+ ///
+ /// 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> GetStatesetWithHttpMessagesAsync(string statesetId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
+ {
+ if (Client.Geography == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.Geography");
+ }
+ if (statesetId == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "statesetId");
+ }
+ string apiVersion = "2.0";
+ // Tracing
+ bool _shouldTrace = ServiceClientTracing.IsEnabled;
+ string _invocationId = null;
+ if (_shouldTrace)
+ {
+ _invocationId = ServiceClientTracing.NextInvocationId.ToString();
+ Dictionary