Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore) expose x-ms-client-id property in MapsAccount #5108

Merged
merged 1 commit into from
Dec 22, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 6 additions & 5 deletions src/SDKs/Maps/Management.Maps/Generated/IMapsManagementClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -53,19 +53,20 @@ public partial interface IMapsManagementClient : System.IDisposable
string ApiVersion { get; }

/// <summary>
/// Gets or sets the preferred language for the response.
/// The preferred language for the response.
/// </summary>
string AcceptLanguage { get; set; }

/// <summary>
/// Gets or sets the retry timeout in seconds for Long Running
/// Operations. Default value is 30.
/// The retry timeout in seconds for Long Running Operations. Default
/// value is 30.
/// </summary>
int? LongRunningOperationRetryTimeout { get; set; }

/// <summary>
/// When set to true a unique x-ms-client-request-id value is generated
/// and included in each request. Default is true.
/// Whether a unique x-ms-client-request-id should be generated. When
/// set to true a unique x-ms-client-request-id value is generated and
/// included in each request. Default is true.
/// </summary>
bool? GenerateClientRequestId { get; set; }

Expand Down
51 changes: 46 additions & 5 deletions src/SDKs/Maps/Management.Maps/Generated/MapsManagementClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -59,19 +59,20 @@ public partial class MapsManagementClient : ServiceClient<MapsManagementClient>,
public string ApiVersion { get; private set; }

/// <summary>
/// Gets or sets the preferred language for the response.
/// The preferred language for the response.
/// </summary>
public string AcceptLanguage { get; set; }

/// <summary>
/// Gets or sets the retry timeout in seconds for Long Running Operations.
/// Default value is 30.
/// The retry timeout in seconds for Long Running Operations. Default value is
/// 30.
/// </summary>
public int? LongRunningOperationRetryTimeout { get; set; }

/// <summary>
/// When set to true a unique x-ms-client-request-id value is generated and
/// included in each request. Default is true.
/// Whether a unique x-ms-client-request-id should be generated. When set to
/// true a unique x-ms-client-request-id value is generated and included in
/// each request. Default is true.
/// </summary>
public bool? GenerateClientRequestId { get; set; }

Expand All @@ -80,6 +81,19 @@ public partial class MapsManagementClient : ServiceClient<MapsManagementClient>,
/// </summary>
public virtual IAccountsOperations Accounts { get; private set; }

/// <summary>
/// Initializes a new instance of the MapsManagementClient class.
/// </summary>
/// <param name='httpClient'>
/// HttpClient to be used
/// </param>
/// <param name='disposeHttpClient'>
/// True: will dispose the provided httpClient on calling MapsManagementClient.Dispose(). False: will not dispose provided httpClient</param>
protected MapsManagementClient(HttpClient httpClient, bool disposeHttpClient) : base(httpClient, disposeHttpClient)
{
Initialize();
}

/// <summary>
/// Initializes a new instance of the MapsManagementClient class.
/// </summary>
Expand Down Expand Up @@ -175,6 +189,33 @@ public MapsManagementClient(ServiceClientCredentials credentials, params Delegat
}
}

/// <summary>
/// Initializes a new instance of the MapsManagementClient class.
/// </summary>
/// <param name='credentials'>
/// Required. Credentials needed for the client to connect to Azure.
/// </param>
/// <param name='httpClient'>
/// HttpClient to be used
/// </param>
/// <param name='disposeHttpClient'>
/// True: will dispose the provided httpClient on calling MapsManagementClient.Dispose(). False: will not dispose provided httpClient</param>
/// <exception cref="System.ArgumentNullException">
/// Thrown when a required parameter is null
/// </exception>
public MapsManagementClient(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);
}
}

/// <summary>
/// Initializes a new instance of the MapsManagementClient class.
/// </summary>
Expand Down
10 changes: 9 additions & 1 deletion src/SDKs/Maps/Management.Maps/Generated/Models/MapsAccount.cs
Original file line number Diff line number Diff line change
Expand Up @@ -43,12 +43,14 @@ public MapsAccount()
/// provided for a resource. Each tag must have a key no greater than
/// 128 characters and value no greater than 256 characters.</param>
/// <param name="sku">The SKU of this account.</param>
public MapsAccount(string id = default(string), string name = default(string), string type = default(string), string location = default(string), IDictionary<string, string> tags = default(IDictionary<string, string>), Sku sku = default(Sku))
/// <param name="properties">The map account properties.</param>
public MapsAccount(string id = default(string), string name = default(string), string type = default(string), string location = default(string), IDictionary<string, string> tags = default(IDictionary<string, string>), Sku sku = default(Sku), MapsAccountProperties properties = default(MapsAccountProperties))
: base(id, name, type)
{
Location = location;
Tags = tags;
Sku = sku;
Properties = properties;
CustomInit();
}

Expand Down Expand Up @@ -79,6 +81,12 @@ public MapsAccount()
[JsonProperty(PropertyName = "sku")]
public Sku Sku { get; private set; }

/// <summary>
/// Gets the map account properties.
/// </summary>
[JsonProperty(PropertyName = "properties")]
public MapsAccountProperties Properties { get; private set; }

/// <summary>
/// Validate the object.
/// </summary>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
// <auto-generated>
// 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.
// </auto-generated>

namespace Microsoft.Azure.Management.Maps.Models
{
using Newtonsoft.Json;
using System.Linq;

/// <summary>
/// Additional Map account properties
/// </summary>
public partial class MapsAccountProperties
{
/// <summary>
/// Initializes a new instance of the MapsAccountProperties class.
/// </summary>
public MapsAccountProperties()
{
CustomInit();
}

/// <summary>
/// Initializes a new instance of the MapsAccountProperties class.
/// </summary>
/// <param name="xMsClientId">A unique identifier for the maps
/// account</param>
public MapsAccountProperties(string xMsClientId = default(string))
{
XMsClientId = xMsClientId;
CustomInit();
}

/// <summary>
/// An initialization method that performs custom operations like setting defaults
/// </summary>
partial void CustomInit();

/// <summary>
/// Gets or sets a unique identifier for the maps account
/// </summary>
[JsonProperty(PropertyName = "x-ms-client-id")]
public string XMsClientId { get; set; }

}
}
Original file line number Diff line number Diff line change
Expand Up @@ -24,5 +24,16 @@ public static IEnumerable<Tuple<string, string, string>> ApiInfo_AzureMapsResour
}.AsEnumerable();
}
}
// BEGIN: Code Generation Metadata Section
public static readonly String AutoRestVersion = "latest";
public static readonly String AutoRestBootStrapperVersion = "autorest@2.0.4283";
public static readonly String AutoRestCmdExecuted = "cmd.exe /c autorest.cmd https://github.com/Azure/azure-rest-api-specs/blob/master/specification/maps/resource-manager/readme.md --csharp --version=latest --reflect-api-versions --csharp-sdks-folder=C:\\code\\github\\az-sdk-net\\src\\SDKs";
public static readonly String GithubForkName = "Azure";
public static readonly String GithubBranchName = "master";
public static readonly String GithubCommidId = "7119de004768fea8a3a2571e3e729d6e20d7264d";
public static readonly String CodeGenerationErrors = "";
public static readonly String GithubRepoName = "azure-rest-api-specs";
// END: Code Generation Metadata Section
}
}

Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@
<PackageId>Microsoft.Azure.Management.Maps</PackageId>
<PackageReleaseNotes>This package replaces Microsoft.Azure.Management.LocationBasedServices. Azure Location Based Services is now Azure Maps.</PackageReleaseNotes>
<Description>Microsoft Azure Management Maps Library</Description>
<VersionPrefix>1.0.1</VersionPrefix>
<VersionPrefix>1.0.2</VersionPrefix>
<AssemblyName>Microsoft.Azure.Management.Maps</AssemblyName>
<PackageTags>Microsoft Azure Maps management;Location Services;Location Services management;REST HTTP client;windowsazureofficial;netcore451511</PackageTags>
<PackageReleaseNotes>Taking dependency on 10.0.3 version of Newtonsoft nuget package.</PackageReleaseNotes>
<PackageReleaseNotes>Expose the x-ms-client-id property.</PackageReleaseNotes>
</PropertyGroup>
<PropertyGroup>
<TargetFrameworks>net452;netstandard1.4</TargetFrameworks>
Expand Down
2 changes: 1 addition & 1 deletion src/SDKs/Maps/Management.Maps/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
[assembly: AssemblyDescription("Provides Microsoft Azure Maps management functions for managing Microsoft Azure Maps accounts.")]

[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.1.0")]
[assembly: AssemblyFileVersion("1.0.2.0")]

[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("Microsoft")]
Expand Down
12 changes: 7 additions & 5 deletions src/SDKs/Maps/Maps.Tests/Helpers/MapsManagementTestUtilities.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@ public static class MapsManagementTestUtilities
// These are used to create default accounts
public static string DefaultResourceGroupLocation = IsTestTenant ? null : "westus";
public static string DefaultLocation = IsTestTenant ? null : "global";
public const string DefaultSkuName = "S0";
public const string DefaultSkuName = "s0";
public const string S1SkuName = "s1";
public static Dictionary<string, string> DefaultTags
= new Dictionary<string, string> { { "key1", "value1" }, { "key2", "value2" } };

Expand Down Expand Up @@ -120,18 +121,19 @@ public static void VerifyAccountProperties(MapsAccount account, bool useDefaults

if (useDefaults)
{
Assert.Equal(MapsManagementTestUtilities.DefaultLocation, account.Location);
Assert.Equal(MapsManagementTestUtilities.DefaultSkuName, account.Sku.Name);
Assert.Equal(MapsManagementTestUtilities.DefaultLocation, account.Location, ignoreCase: true);
Assert.Equal(MapsManagementTestUtilities.DefaultSkuName, account.Sku.Name, ignoreCase: true);

Assert.NotNull(account.Tags);
Assert.NotNull(account.Properties.XMsClientId);
Assert.Equal(2, account.Tags.Count);
Assert.Equal("value1", account.Tags["key1"]);
Assert.Equal("value2", account.Tags["key2"]);
}
else
{
Assert.Equal(skuName, account.Sku.Name);
Assert.Equal(location, account.Location);
Assert.Equal(skuName, account.Sku.Name, ignoreCase: true);
Assert.Equal(location, account.Location, ignoreCase: true);
}
}

Expand Down
Loading