Skip to content

Commit d650ed4

Browse files
authored
[StorageSync] Add SDK helper (Azure#26874)
* StorageSync Helper generator * generate powershell and fix XML * add CS1573 CS0114 warning skipped * update ChangeLog.md
1 parent 014dbe9 commit d650ed4

33 files changed

+3755
-8
lines changed
Lines changed: 341 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,341 @@
1+
// Copyright (c) Microsoft Corporation. All rights reserved.
2+
// Licensed under the MIT License. See License.txt in the project root for license information.
3+
// Code generated by Microsoft (R) AutoRest Code Generator.
4+
// Changes may cause incorrect behavior and will be lost if the code is regenerated.
5+
6+
namespace Microsoft.Azure.PowerShell.Cmdlets.StorageSync.Helper.Authorization
7+
{
8+
using System.Linq;
9+
using Microsoft.Rest;
10+
using Microsoft.Rest.Azure;
11+
using Models;
12+
13+
/// <summary>
14+
/// Role based access control provides you a way to apply granular level policy
15+
/// administration down to individual resources or resource groups. These
16+
/// operations allow you to manage role definitions. A role definition
17+
/// describes the set of actions that can be performed on resources.
18+
/// </summary>
19+
public partial class AuthorizationManagementClient : Microsoft.Rest.ServiceClient<AuthorizationManagementClient>, IAuthorizationManagementClient, IAzureClient
20+
{
21+
/// <summary>
22+
/// The base URI of the service.
23+
/// </summary>
24+
public System.Uri BaseUri { get; set; }
25+
/// <summary>
26+
/// Gets or sets json serialization settings.
27+
/// </summary>
28+
public Newtonsoft.Json.JsonSerializerSettings SerializationSettings { get; private set; }
29+
/// <summary>
30+
/// Gets or sets json deserialization settings.
31+
/// </summary>
32+
public Newtonsoft.Json.JsonSerializerSettings DeserializationSettings { get; private set; }
33+
/// <summary>
34+
/// Credentials needed for the client to connect to Azure.
35+
/// </summary>
36+
public Microsoft.Rest.ServiceClientCredentials Credentials { get; private set; }
37+
38+
/// <summary>
39+
/// The ID of the target subscription.
40+
/// </summary>
41+
public string SubscriptionId { get; set;}
42+
43+
/// <summary>
44+
/// The preferred language for the response.
45+
/// </summary>
46+
public string AcceptLanguage { get; set;}
47+
48+
/// <summary>
49+
/// The retry timeout in seconds for Long Running Operations. Default
50+
/// /// value is 30.
51+
/// </summary>
52+
public int? LongRunningOperationRetryTimeout { get; set;}
53+
54+
/// <summary>
55+
/// Whether a unique x-ms-client-request-id should be generated. When
56+
/// /// set to true a unique x-ms-client-request-id value is generated and
57+
/// /// included in each request. Default is true.
58+
/// </summary>
59+
public bool? GenerateClientRequestId { get; set;}
60+
61+
/// <summary>
62+
/// Gets the IRoleDefinitionsOperations
63+
/// </summary>
64+
public virtual IRoleDefinitionsOperations RoleDefinitions { get; private set; }
65+
/// <summary>
66+
/// Gets the IRoleAssignmentsOperations
67+
/// </summary>
68+
public virtual IRoleAssignmentsOperations RoleAssignments { get; private set; }
69+
/// <summary>
70+
/// Initializes a new instance of the AuthorizationManagementClient class.
71+
/// </summary>
72+
/// <param name='httpClient'>
73+
/// HttpClient to be used
74+
/// </param>
75+
/// <param name='disposeHttpClient'>
76+
/// True: will dispose the provided httpClient on calling AuthorizationManagementClient.Dispose(). False: will not dispose provided httpClient</param>
77+
protected AuthorizationManagementClient(System.Net.Http.HttpClient httpClient, bool disposeHttpClient) : base(httpClient, disposeHttpClient)
78+
{
79+
this.Initialize();
80+
}
81+
/// <summary>
82+
/// Initializes a new instance of the AuthorizationManagementClient class.
83+
/// </summary>
84+
/// <param name='handlers'>
85+
/// Optional. The delegating handlers to add to the http client pipeline.
86+
/// </param>
87+
protected AuthorizationManagementClient(params System.Net.Http.DelegatingHandler[] handlers) : base(handlers)
88+
{
89+
this.Initialize();
90+
}
91+
/// <summary>
92+
/// Initializes a new instance of the AuthorizationManagementClient class.
93+
/// </summary>
94+
/// <param name='rootHandler'>
95+
/// Optional. The http client handler used to handle http transport.
96+
/// </param>
97+
/// <param name='handlers'>
98+
/// Optional. The delegating handlers to add to the http client pipeline.
99+
/// </param>
100+
protected AuthorizationManagementClient(System.Net.Http.HttpClientHandler rootHandler, params System.Net.Http.DelegatingHandler[] handlers) : base(rootHandler, handlers)
101+
{
102+
this.Initialize();
103+
}
104+
/// <summary>
105+
/// Initializes a new instance of the AuthorizationManagementClient class.
106+
/// </summary>
107+
/// <param name='baseUri'>
108+
/// Optional. The base URI of the service.
109+
/// </param>
110+
/// <param name='handlers'>
111+
/// Optional. The delegating handlers to add to the http client pipeline.
112+
/// </param>
113+
/// <exception cref="System.ArgumentNullException">
114+
/// Thrown when a required parameter is null
115+
/// </exception>
116+
protected AuthorizationManagementClient(System.Uri baseUri, params System.Net.Http.DelegatingHandler[] handlers) : this(handlers)
117+
{
118+
if (baseUri == null)
119+
{
120+
throw new System.ArgumentNullException("baseUri");
121+
}
122+
this.BaseUri = baseUri;
123+
}
124+
/// <summary>
125+
/// Initializes a new instance of the AuthorizationManagementClient class.
126+
/// </summary>
127+
/// <param name='baseUri'>
128+
/// Optional. The base URI of the service.
129+
/// </param>
130+
/// <param name='rootHandler'>
131+
/// Optional. The http client handler used to handle http transport.
132+
/// </param>
133+
/// <param name='handlers'>
134+
/// Optional. The delegating handlers to add to the http client pipeline.
135+
/// </param>
136+
/// <exception cref="System.ArgumentNullException">
137+
/// Thrown when a required parameter is null
138+
/// </exception>
139+
protected AuthorizationManagementClient(System.Uri baseUri, System.Net.Http.HttpClientHandler rootHandler, params System.Net.Http.DelegatingHandler[] handlers) : this(rootHandler, handlers)
140+
{
141+
if (baseUri == null)
142+
{
143+
throw new System.ArgumentNullException("baseUri");
144+
}
145+
146+
this.BaseUri = baseUri;
147+
}
148+
/// <summary>
149+
/// Initializes a new instance of the AuthorizationManagementClient class.
150+
/// </summary>
151+
/// <param name='credentials'>
152+
/// Required. Credentials needed for the client to connect to Azure.
153+
/// </param>
154+
/// <param name='handlers'>
155+
/// Optional. The delegating handlers to add to the http client pipeline.
156+
/// </param>
157+
/// <exception cref="System.ArgumentNullException">
158+
/// Thrown when a required parameter is null
159+
/// </exception>
160+
public AuthorizationManagementClient(Microsoft.Rest.ServiceClientCredentials credentials, params System.Net.Http.DelegatingHandler[] handlers) : this(handlers)
161+
{
162+
if (credentials == null)
163+
{
164+
throw new System.ArgumentNullException("credentials");
165+
}
166+
this.Credentials = credentials;
167+
if (this.Credentials != null)
168+
{
169+
this.Credentials.InitializeServiceClient(this);
170+
}
171+
172+
}
173+
/// <summary>
174+
/// Initializes a new instance of the AuthorizationManagementClient class.
175+
/// </summary>
176+
/// <param name="credentials">
177+
/// Required. Credentials needed for the client to connect to Azure.
178+
/// </param>
179+
/// <param name='httpClient'>
180+
/// HttpClient to be used
181+
/// </param>
182+
/// <param name='disposeHttpClient'>
183+
/// True: will dispose the provided httpClient on calling AuthorizationManagementClient.Dispose(). False: will not dispose provided httpClient</param>
184+
/// <exception cref="System.ArgumentNullException">
185+
/// Thrown when a required parameter is null
186+
/// </exception>
187+
public AuthorizationManagementClient(Microsoft.Rest.ServiceClientCredentials credentials, System.Net.Http.HttpClient httpClient, bool disposeHttpClient) : this(httpClient, disposeHttpClient)
188+
{
189+
if (credentials == null)
190+
{
191+
throw new System.ArgumentNullException("credentials");
192+
}
193+
this.Credentials = credentials;
194+
if (this.Credentials != null)
195+
{
196+
this.Credentials.InitializeServiceClient(this);
197+
}
198+
199+
}
200+
/// <summary>
201+
/// Initializes a new instance of the AuthorizationManagementClient class.
202+
/// </summary>
203+
/// <param name="credentials">
204+
/// Required. Credentials needed for the client to connect to Azure.
205+
/// </param>
206+
/// <param name='rootHandler'>
207+
/// Optional. The http client handler used to handle http transport.
208+
/// </param>
209+
/// <param name='handlers'>
210+
/// Optional. The delegating handlers to add to the http client pipeline.
211+
/// </param>
212+
/// <exception cref="System.ArgumentNullException">
213+
/// Thrown when a required parameter is null
214+
/// </exception>
215+
public AuthorizationManagementClient(Microsoft.Rest.ServiceClientCredentials credentials, System.Net.Http.HttpClientHandler rootHandler, params System.Net.Http.DelegatingHandler[] handlers) : this(rootHandler, handlers)
216+
{
217+
if (credentials == null)
218+
{
219+
throw new System.ArgumentNullException("credentials");
220+
}
221+
this.Credentials = credentials;
222+
if (this.Credentials != null)
223+
{
224+
this.Credentials.InitializeServiceClient(this);
225+
}
226+
227+
}
228+
/// <summary>
229+
/// Initializes a new instance of the AuthorizationManagementClient class.
230+
/// </summary>
231+
/// <param name='baseUri'>
232+
/// Optional. The base URI of the service.
233+
/// </param>
234+
/// <param name="credentials">
235+
/// Required. Credentials needed for the client to connect to Azure.
236+
/// </param>
237+
/// <param name='handlers'>
238+
/// Optional. The delegating handlers to add to the http client pipeline.
239+
/// </param>
240+
/// <exception cref="System.ArgumentNullException">
241+
/// Thrown when a required parameter is null
242+
/// </exception>
243+
public AuthorizationManagementClient(System.Uri baseUri, Microsoft.Rest.ServiceClientCredentials credentials, params System.Net.Http.DelegatingHandler[] handlers) : this(handlers)
244+
{
245+
if (baseUri == null)
246+
{
247+
throw new System.ArgumentNullException("baseUri");
248+
}
249+
if (credentials == null)
250+
{
251+
throw new System.ArgumentNullException("credentials");
252+
}
253+
this.BaseUri = baseUri;
254+
this.Credentials = credentials;
255+
if (this.Credentials != null)
256+
{
257+
this.Credentials.InitializeServiceClient(this);
258+
}
259+
260+
}
261+
/// <summary>
262+
/// Initializes a new instance of the AuthorizationManagementClient class.
263+
/// </summary>
264+
/// <param name='baseUri'>
265+
/// Optional. The base URI of the service.
266+
/// </param>
267+
/// <param name="credentials">
268+
/// Required. Credentials needed for the client to connect to Azure.
269+
/// </param>
270+
/// <param name='rootHandler'>
271+
/// Optional. The http client handler used to handle http transport.
272+
/// </param>
273+
/// <exception cref="System.ArgumentNullException">
274+
/// Thrown when a required parameter is null
275+
/// </exception>
276+
public AuthorizationManagementClient(System.Uri baseUri, Microsoft.Rest.ServiceClientCredentials credentials, System.Net.Http.HttpClientHandler rootHandler, params System.Net.Http.DelegatingHandler[] handlers) : this(rootHandler, handlers)
277+
{
278+
if (baseUri == null)
279+
{
280+
throw new System.ArgumentNullException("baseUri");
281+
}
282+
if (credentials == null)
283+
{
284+
throw new System.ArgumentNullException("credentials");
285+
}
286+
this.BaseUri = baseUri;
287+
this.Credentials = credentials;
288+
if (this.Credentials != null)
289+
{
290+
this.Credentials.InitializeServiceClient(this);
291+
}
292+
293+
}
294+
/// <summary>
295+
/// An optional partial-method to perform custom initialization.
296+
/// </summary>
297+
partial void CustomInitialize();
298+
299+
/// <summary>
300+
/// Initializes client properties.
301+
/// </summary>
302+
private void Initialize()
303+
{
304+
this.RoleDefinitions = new RoleDefinitionsOperations(this);
305+
this.RoleAssignments = new RoleAssignmentsOperations(this);
306+
this.BaseUri = new System.Uri("https://management.azure.com");
307+
this.AcceptLanguage = "en-US";
308+
this.LongRunningOperationRetryTimeout = 30;
309+
this.GenerateClientRequestId = true;
310+
SerializationSettings = new Newtonsoft.Json.JsonSerializerSettings
311+
{
312+
Formatting = Newtonsoft.Json.Formatting.Indented,
313+
DateFormatHandling = Newtonsoft.Json.DateFormatHandling.IsoDateFormat,
314+
DateTimeZoneHandling = Newtonsoft.Json.DateTimeZoneHandling.Utc,
315+
NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore,
316+
ReferenceLoopHandling = Newtonsoft.Json.ReferenceLoopHandling.Serialize,
317+
ContractResolver = new Microsoft.Rest.Serialization.ReadOnlyJsonContractResolver(),
318+
Converters = new System.Collections.Generic.List<Newtonsoft.Json.JsonConverter>
319+
{
320+
new Microsoft.Rest.Serialization.Iso8601TimeSpanConverter()
321+
}
322+
};
323+
SerializationSettings.Converters.Add(new Microsoft.Rest.Serialization.TransformationJsonConverter());
324+
DeserializationSettings = new Newtonsoft.Json.JsonSerializerSettings
325+
{
326+
DateFormatHandling = Newtonsoft.Json.DateFormatHandling.IsoDateFormat,
327+
DateTimeZoneHandling = Newtonsoft.Json.DateTimeZoneHandling.Utc,
328+
NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore,
329+
ReferenceLoopHandling = Newtonsoft.Json.ReferenceLoopHandling.Serialize,
330+
ContractResolver = new Microsoft.Rest.Serialization.ReadOnlyJsonContractResolver(),
331+
Converters = new System.Collections.Generic.List<Newtonsoft.Json.JsonConverter>
332+
{
333+
new Microsoft.Rest.Serialization.Iso8601TimeSpanConverter()
334+
}
335+
};
336+
CustomInitialize();
337+
DeserializationSettings.Converters.Add(new Microsoft.Rest.Serialization.TransformationJsonConverter());
338+
DeserializationSettings.Converters.Add(new Microsoft.Rest.Azure.CloudErrorJsonConverter());
339+
}
340+
}
341+
}

0 commit comments

Comments
 (0)