Skip to content

Commit 3328105

Browse files
Generated new sdk for 2022-11-01
1 parent 871a7be commit 3328105

File tree

1,197 files changed

+311553
-61
lines changed

Some content is hidden

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

1,197 files changed

+311553
-61
lines changed

src/Network/Network.Management.Sdk/Generated/AdminRuleCollectionsOperations.cs

Lines changed: 1185 additions & 0 deletions
Large diffs are not rendered by default.

src/Network/Network.Management.Sdk/Generated/AdminRuleCollectionsOperationsExtensions.cs

Lines changed: 371 additions & 0 deletions
Large diffs are not rendered by default.

src/Network/Network.Management.Sdk/Generated/AdminRulesOperations.cs

Lines changed: 1203 additions & 0 deletions
Large diffs are not rendered by default.

src/Network/Network.Management.Sdk/Generated/AdminRulesOperationsExtensions.cs

Lines changed: 389 additions & 0 deletions
Large diffs are not rendered by default.

src/Network/Network.Management.Sdk/Generated/ApplicationGatewayPrivateEndpointConnectionsOperations.cs

Lines changed: 1078 additions & 0 deletions
Large diffs are not rendered by default.

src/Network/Network.Management.Sdk/Generated/ApplicationGatewayPrivateEndpointConnectionsOperationsExtensions.cs

Lines changed: 339 additions & 0 deletions
Large diffs are not rendered by default.

src/Network/Network.Management.Sdk/Generated/ApplicationGatewayPrivateLinkResourcesOperations.cs

Lines changed: 421 additions & 0 deletions
Large diffs are not rendered by default.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,99 @@
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.Management.Network
12+
{
13+
using Microsoft.Rest;
14+
using Microsoft.Rest.Azure;
15+
using Models;
16+
using System.Threading;
17+
using System.Threading.Tasks;
18+
19+
/// <summary>
20+
/// Extension methods for ApplicationGatewayPrivateLinkResourcesOperations.
21+
/// </summary>
22+
public static partial class ApplicationGatewayPrivateLinkResourcesOperationsExtensions
23+
{
24+
/// <summary>
25+
/// Lists all private link resources on an application gateway.
26+
/// </summary>
27+
/// <param name='operations'>
28+
/// The operations group for this extension method.
29+
/// </param>
30+
/// <param name='resourceGroupName'>
31+
/// The name of the resource group.
32+
/// </param>
33+
/// <param name='applicationGatewayName'>
34+
/// The name of the application gateway.
35+
/// </param>
36+
public static IPage<ApplicationGatewayPrivateLinkResource> List(this IApplicationGatewayPrivateLinkResourcesOperations operations, string resourceGroupName, string applicationGatewayName)
37+
{
38+
return operations.ListAsync(resourceGroupName, applicationGatewayName).GetAwaiter().GetResult();
39+
}
40+
41+
/// <summary>
42+
/// Lists all private link resources on an application gateway.
43+
/// </summary>
44+
/// <param name='operations'>
45+
/// The operations group for this extension method.
46+
/// </param>
47+
/// <param name='resourceGroupName'>
48+
/// The name of the resource group.
49+
/// </param>
50+
/// <param name='applicationGatewayName'>
51+
/// The name of the application gateway.
52+
/// </param>
53+
/// <param name='cancellationToken'>
54+
/// The cancellation token.
55+
/// </param>
56+
public static async Task<IPage<ApplicationGatewayPrivateLinkResource>> ListAsync(this IApplicationGatewayPrivateLinkResourcesOperations operations, string resourceGroupName, string applicationGatewayName, CancellationToken cancellationToken = default(CancellationToken))
57+
{
58+
using (var _result = await operations.ListWithHttpMessagesAsync(resourceGroupName, applicationGatewayName, null, cancellationToken).ConfigureAwait(false))
59+
{
60+
return _result.Body;
61+
}
62+
}
63+
64+
/// <summary>
65+
/// Lists all private link resources on an application gateway.
66+
/// </summary>
67+
/// <param name='operations'>
68+
/// The operations group for this extension method.
69+
/// </param>
70+
/// <param name='nextPageLink'>
71+
/// The NextLink from the previous successful call to List operation.
72+
/// </param>
73+
public static IPage<ApplicationGatewayPrivateLinkResource> ListNext(this IApplicationGatewayPrivateLinkResourcesOperations operations, string nextPageLink)
74+
{
75+
return operations.ListNextAsync(nextPageLink).GetAwaiter().GetResult();
76+
}
77+
78+
/// <summary>
79+
/// Lists all private link resources on an application gateway.
80+
/// </summary>
81+
/// <param name='operations'>
82+
/// The operations group for this extension method.
83+
/// </param>
84+
/// <param name='nextPageLink'>
85+
/// The NextLink from the previous successful call to List operation.
86+
/// </param>
87+
/// <param name='cancellationToken'>
88+
/// The cancellation token.
89+
/// </param>
90+
public static async Task<IPage<ApplicationGatewayPrivateLinkResource>> ListNextAsync(this IApplicationGatewayPrivateLinkResourcesOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken))
91+
{
92+
using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false))
93+
{
94+
return _result.Body;
95+
}
96+
}
97+
98+
}
99+
}
Lines changed: 239 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,239 @@
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.Management.Network
12+
{
13+
using Microsoft.Rest;
14+
using Microsoft.Rest.Azure;
15+
using Models;
16+
using Newtonsoft.Json;
17+
using System.Collections;
18+
using System.Collections.Generic;
19+
using System.Linq;
20+
using System.Net;
21+
using System.Net.Http;
22+
using System.Threading;
23+
using System.Threading.Tasks;
24+
25+
/// <summary>
26+
/// ApplicationGatewayWafDynamicManifestsDefaultOperations operations.
27+
/// </summary>
28+
internal partial class ApplicationGatewayWafDynamicManifestsDefaultOperations : IServiceOperations<NetworkManagementClient>, IApplicationGatewayWafDynamicManifestsDefaultOperations
29+
{
30+
/// <summary>
31+
/// Initializes a new instance of the ApplicationGatewayWafDynamicManifestsDefaultOperations class.
32+
/// </summary>
33+
/// <param name='client'>
34+
/// Reference to the service client.
35+
/// </param>
36+
/// <exception cref="System.ArgumentNullException">
37+
/// Thrown when a required parameter is null
38+
/// </exception>
39+
internal ApplicationGatewayWafDynamicManifestsDefaultOperations(NetworkManagementClient client)
40+
{
41+
if (client == null)
42+
{
43+
throw new System.ArgumentNullException("client");
44+
}
45+
Client = client;
46+
}
47+
48+
/// <summary>
49+
/// Gets a reference to the NetworkManagementClient
50+
/// </summary>
51+
public NetworkManagementClient Client { get; private set; }
52+
53+
/// <summary>
54+
/// Gets the regional application gateway waf manifest.
55+
/// </summary>
56+
/// <param name='location'>
57+
/// The region where the nrp are located at.
58+
/// </param>
59+
/// <param name='customHeaders'>
60+
/// Headers that will be added to request.
61+
/// </param>
62+
/// <param name='cancellationToken'>
63+
/// The cancellation token.
64+
/// </param>
65+
/// <exception cref="CloudException">
66+
/// Thrown when the operation returned an invalid status code
67+
/// </exception>
68+
/// <exception cref="SerializationException">
69+
/// Thrown when unable to deserialize the response
70+
/// </exception>
71+
/// <exception cref="ValidationException">
72+
/// Thrown when a required parameter is null
73+
/// </exception>
74+
/// <exception cref="System.ArgumentNullException">
75+
/// Thrown when a required parameter is null
76+
/// </exception>
77+
/// <return>
78+
/// A response object containing the response body and response headers.
79+
/// </return>
80+
public async Task<AzureOperationResponse<ApplicationGatewayWafDynamicManifestResult>> GetWithHttpMessagesAsync(string location, Dictionary<string, List<string>> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
81+
{
82+
if (location == null)
83+
{
84+
throw new ValidationException(ValidationRules.CannotBeNull, "location");
85+
}
86+
if (Client.SubscriptionId == null)
87+
{
88+
throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId");
89+
}
90+
string apiVersion = "2022-11-01";
91+
// Tracing
92+
bool _shouldTrace = ServiceClientTracing.IsEnabled;
93+
string _invocationId = null;
94+
if (_shouldTrace)
95+
{
96+
_invocationId = ServiceClientTracing.NextInvocationId.ToString();
97+
Dictionary<string, object> tracingParameters = new Dictionary<string, object>();
98+
tracingParameters.Add("location", location);
99+
tracingParameters.Add("apiVersion", apiVersion);
100+
tracingParameters.Add("cancellationToken", cancellationToken);
101+
ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters);
102+
}
103+
// Construct URL
104+
var _baseUrl = Client.BaseUri.AbsoluteUri;
105+
var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.Network/locations/{location}/applicationGatewayWafDynamicManifests/dafault").ToString();
106+
_url = _url.Replace("{location}", System.Uri.EscapeDataString(location));
107+
_url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId));
108+
List<string> _queryParameters = new List<string>();
109+
if (apiVersion != null)
110+
{
111+
_queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion)));
112+
}
113+
if (_queryParameters.Count > 0)
114+
{
115+
_url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters);
116+
}
117+
// Create HTTP transport objects
118+
var _httpRequest = new HttpRequestMessage();
119+
HttpResponseMessage _httpResponse = null;
120+
_httpRequest.Method = new HttpMethod("GET");
121+
_httpRequest.RequestUri = new System.Uri(_url);
122+
// Set Headers
123+
if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value)
124+
{
125+
_httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString());
126+
}
127+
if (Client.AcceptLanguage != null)
128+
{
129+
if (_httpRequest.Headers.Contains("accept-language"))
130+
{
131+
_httpRequest.Headers.Remove("accept-language");
132+
}
133+
_httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage);
134+
}
135+
136+
137+
if (customHeaders != null)
138+
{
139+
foreach(var _header in customHeaders)
140+
{
141+
if (_httpRequest.Headers.Contains(_header.Key))
142+
{
143+
_httpRequest.Headers.Remove(_header.Key);
144+
}
145+
_httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value);
146+
}
147+
}
148+
149+
// Serialize Request
150+
string _requestContent = null;
151+
// Set Credentials
152+
if (Client.Credentials != null)
153+
{
154+
cancellationToken.ThrowIfCancellationRequested();
155+
await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
156+
}
157+
// Send Request
158+
if (_shouldTrace)
159+
{
160+
ServiceClientTracing.SendRequest(_invocationId, _httpRequest);
161+
}
162+
cancellationToken.ThrowIfCancellationRequested();
163+
_httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
164+
if (_shouldTrace)
165+
{
166+
ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse);
167+
}
168+
HttpStatusCode _statusCode = _httpResponse.StatusCode;
169+
cancellationToken.ThrowIfCancellationRequested();
170+
string _responseContent = null;
171+
if ((int)_statusCode != 200)
172+
{
173+
var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode));
174+
try
175+
{
176+
_responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
177+
CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject<CloudError>(_responseContent, Client.DeserializationSettings);
178+
if (_errorBody != null)
179+
{
180+
ex = new CloudException(_errorBody.Message);
181+
ex.Body = _errorBody;
182+
}
183+
}
184+
catch (JsonException)
185+
{
186+
// Ignore the exception
187+
}
188+
ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent);
189+
ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent);
190+
if (_httpResponse.Headers.Contains("x-ms-request-id"))
191+
{
192+
ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault();
193+
}
194+
if (_shouldTrace)
195+
{
196+
ServiceClientTracing.Error(_invocationId, ex);
197+
}
198+
_httpRequest.Dispose();
199+
if (_httpResponse != null)
200+
{
201+
_httpResponse.Dispose();
202+
}
203+
throw ex;
204+
}
205+
// Create Result
206+
var _result = new AzureOperationResponse<ApplicationGatewayWafDynamicManifestResult>();
207+
_result.Request = _httpRequest;
208+
_result.Response = _httpResponse;
209+
if (_httpResponse.Headers.Contains("x-ms-request-id"))
210+
{
211+
_result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault();
212+
}
213+
// Deserialize Response
214+
if ((int)_statusCode == 200)
215+
{
216+
_responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
217+
try
218+
{
219+
_result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject<ApplicationGatewayWafDynamicManifestResult>(_responseContent, Client.DeserializationSettings);
220+
}
221+
catch (JsonException ex)
222+
{
223+
_httpRequest.Dispose();
224+
if (_httpResponse != null)
225+
{
226+
_httpResponse.Dispose();
227+
}
228+
throw new SerializationException("Unable to deserialize the response.", _responseContent, ex);
229+
}
230+
}
231+
if (_shouldTrace)
232+
{
233+
ServiceClientTracing.Exit(_invocationId, _result);
234+
}
235+
return _result;
236+
}
237+
238+
}
239+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
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.Management.Network
12+
{
13+
using Microsoft.Rest;
14+
using Microsoft.Rest.Azure;
15+
using Models;
16+
using System.Threading;
17+
using System.Threading.Tasks;
18+
19+
/// <summary>
20+
/// Extension methods for ApplicationGatewayWafDynamicManifestsDefaultOperations.
21+
/// </summary>
22+
public static partial class ApplicationGatewayWafDynamicManifestsDefaultOperationsExtensions
23+
{
24+
/// <summary>
25+
/// Gets the regional application gateway waf manifest.
26+
/// </summary>
27+
/// <param name='operations'>
28+
/// The operations group for this extension method.
29+
/// </param>
30+
/// <param name='location'>
31+
/// The region where the nrp are located at.
32+
/// </param>
33+
public static ApplicationGatewayWafDynamicManifestResult Get(this IApplicationGatewayWafDynamicManifestsDefaultOperations operations, string location)
34+
{
35+
return operations.GetAsync(location).GetAwaiter().GetResult();
36+
}
37+
38+
/// <summary>
39+
/// Gets the regional application gateway waf manifest.
40+
/// </summary>
41+
/// <param name='operations'>
42+
/// The operations group for this extension method.
43+
/// </param>
44+
/// <param name='location'>
45+
/// The region where the nrp are located at.
46+
/// </param>
47+
/// <param name='cancellationToken'>
48+
/// The cancellation token.
49+
/// </param>
50+
public static async Task<ApplicationGatewayWafDynamicManifestResult> GetAsync(this IApplicationGatewayWafDynamicManifestsDefaultOperations operations, string location, CancellationToken cancellationToken = default(CancellationToken))
51+
{
52+
using (var _result = await operations.GetWithHttpMessagesAsync(location, null, cancellationToken).ConfigureAwait(false))
53+
{
54+
return _result.Body;
55+
}
56+
}
57+
58+
}
59+
}

0 commit comments

Comments
 (0)