Skip to content

Commit 537d04b

Browse files
vthiebaut10dingmeng-xuewyunchi-ms
authored
[Az.Ssh] Preview for new module (#19724)
* Add helpers SDK * Az.Ssh * Partial Scenario tests and bug fixes * Clean up test and add help * Review help files * Address bugs found during review * Record scenario tests and add header to files * Update changelog * Attempt to fix the help file CI failure * Make Related Links in help files be hyperlinks * Add Ssh.Help and Accounts to required assemblies * Add default parameter set to Export-AzSshConfig and fix errors in help files * Add exception for not implementing ShouldProcess. Include Compute in solution and test project * Skip setup agent on Playback mode * Update compute sdk to 57.0.0 of Ssh.Test project * Simplify Config VM tests. Re-record http requests. * Try running tests as 'Live Only * Remove Az.Accounts dll from Required Assemblies * Make utils classes internal * correct code * update code * Remove unused RMProfileClient * update project reference * resolve merge Co-authored-by: dingmeng-xue <[email protected]> Co-authored-by: Yunchi Wang <[email protected]>
1 parent 517caff commit 537d04b

File tree

357 files changed

+36225
-1
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

357 files changed

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

0 commit comments

Comments
 (0)